 Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# st: Ttest and Welch's degrees of freedom

 From Garry Anderson To Subject st: Ttest and Welch's degrees of freedom Date Mon, 18 Apr 2011 18:37:34 +1000

```Dear Statalist,

I was reading the -ttest- entry in the manual on page 1998 (example 3)
and noticed that use of Welch's degrees of freedom can increase the
degrees of freedom compared with the usual degrees of freedom obtained
from an unpaired t-test.

Should Welch's degrees of freedom be larger than n1 + n2 - 2 ?

The commands and output are shown below.

. use http://www.stata-press.com/data/r11/fuel3

. ttest mpg, by(treated)

Two-sample t test with equal variances
------------------------------------------------------------------------
------
Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf.
Interval]
---------+--------------------------------------------------------------
------
0 |      12          21    .7881701    2.730301    19.26525
22.73475
1 |      12       22.75    .9384465    3.250874    20.68449
24.81551
---------+--------------------------------------------------------------
------
combined |      24      21.875    .6264476    3.068954    20.57909
23.17091
---------+--------------------------------------------------------------
------
diff |               -1.75    1.225518               -4.291568
.7915684
------------------------------------------------------------------------
------
diff = mean(0) - mean(1)                                      t =
-1.4280
Ho: diff = 0                                     degrees of freedom =
22

Ha: diff < 0                 Ha: diff != 0                 Ha: diff
> 0
Pr(T < t) = 0.0837         Pr(|T| > |t|) = 0.1673          Pr(T > t) =
0.9163

. ttest mpg, by(treated) welch

Two-sample t test with unequal variances
------------------------------------------------------------------------
------
Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf.
Interval]
---------+--------------------------------------------------------------
------
0 |      12          21    .7881701    2.730301    19.26525
22.73475
1 |      12       22.75    .9384465    3.250874    20.68449
24.81551
---------+--------------------------------------------------------------
------
combined |      24      21.875    .6264476    3.068954    20.57909
23.17091
---------+--------------------------------------------------------------
------
diff |               -1.75    1.225518                -4.28369
.7836902
------------------------------------------------------------------------
------
diff = mean(0) - mean(1)                                      t =
-1.4280
Ho: diff = 0                             Welch's degrees of freedom =
23.2465

Ha: diff < 0                 Ha: diff != 0                 Ha: diff
> 0
Pr(T < t) = 0.0833         Pr(|T| > |t|) = 0.1666          Pr(T > t) =
0.9167

.

Kind regards, Garry

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```