Hello,

In the ttest help Stata notes that a test of differences occurs by subtracting the highest value by the lowest values 'By default, the mean of the group corresponding to
the largest value in the variable in by() is subtracted from the mean of the group with the smallest value in by()'


My data set contains values of 1, 2 and missing.
Value of 1 has 3,000,000 observations
Value of 2 has 600,000 observations
Missing has 2,400,000 observations

When I run the ttest the results output notes 'diff = mean(1) - mean(2) '

My code to run the ttest contains the requirement for unequal means although I do not specify to 'reverse' the means test.

Why do the stata results specify the 'diff = mean(1) - mean(2)' when this is contrary to the default setting in stata where the highest value is subtracted from the lowest value?

Regards
Imtiaz