
© 2003-2005, The Trustees of Indiana University Comparing Group Means: 19
http://www.indiana.edu/~statmath
diff = mean(0) - mean(1) t = 2.7817
Ho: diff = 0 Satterthwaite's degrees of freedom = 35.1098
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(T < t) = 0.9957 Pr(|T| > |t|) = 0.0086 Pr(T > t) = 0.0043
See Satterthwaite’s approximation of 35.110 in the middle of the output. If you want to get
Welch’s approximation, use the
welch as well as unequal options; without the unequal option,
the
welch is ignored.
. ttest kidney, by(west) unequal welch
Two-sample t test with unequal variances
------------------------------------------------------------------------------
Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]
---------+--------------------------------------------------------------------
0 | 20 3.006 .0671111 .3001298 2.865535 3.146465
1 | 24 2.618333 .1221422 .5983722 2.365663 2.871004
---------+--------------------------------------------------------------------
combined | 44 2.794545 .0782542 .5190799 2.636731 2.95236
---------+--------------------------------------------------------------------
diff | .3876667 .139365 .1050824 .6702509
------------------------------------------------------------------------------
diff = mean(0) - mean(1) t = 2.7817
Ho: diff = 0 Welch's degrees of freedom = 36.2258
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(T < t) = 0.9957 Pr(|T| > |t|) = 0.0085 Pr(T > t) = 0.0043
Satterthwaite’s approximation is slightly smaller than Welch’s 36.2258. Again, keep in mind
that these approximations are not integers, but real numbers. The t statistic 2.7817 and its p-
value .0086 reject the null hypothesis of equal population means. The north and east have
larger death rates from kidney cancer per 100 thousand people than the south and west.
For aggregate data, use the
.ttesti command with the necessary options.
. ttesti 20 3.006 .3001298 24 2.618333 .5983722, unequal welch
As mentioned earlier, the
unpaired option of the .ttest command directly compares two
variables without data manipulation. The option treats the two variables as independent of each
other. The following is an example of the unpaired and unequal options.
. ttest bladder=kidney, unpaired unequal welch
Two-sample t test with unequal variances
------------------------------------------------------------------------------
Variable | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]
---------+--------------------------------------------------------------------
bladder | 44 4.121136 .1454679 .9649249 3.827772 4.4145
kidney | 44 2.794545 .0782542 .5190799 2.636731 2.95236
---------+--------------------------------------------------------------------
combined | 88 3.457841 .1086268 1.019009 3.241933 3.673748
---------+--------------------------------------------------------------------
diff | 1.326591 .1651806 .9968919 1.65629
------------------------------------------------------------------------------
diff = mean(bladder) - mean(kidney) t = 8.0312
Ho: diff = 0 Welch's degrees of freedom = 67.0324