01 January 1970 13 3K Report

I am not a (habitual) useR, but I understand that the default setting for the t.test command in R is to return an unequal variances t-test that is called the "Welch Two Sample t-test". But for reasons I won't go into here, I found myself wondering if the test it calls Welch's t-test actually uses Satterthwaite's (1946) degrees of freedom, NOT Welch's (1947) degrees of freedom. As the Stata documentation shows, they are not the same. I've put the two equations side-by-side on a slide (see attached image).

Source: https://www.stata.com/manuals/rttest.pdf (page 10)

Because Stata has options for both the Satterthwaite & Welch t-tests, I decided to compare the results from R's t.test to Stata's ttest. I used this example to do so:

  • https://rcompanion.org/rcompanion/d_02.html

My results can be seen in the attached text file. (View with a fixed font.) In order to get the result R calls Welch's t-test, I have to use the unequal option for Stata's ttest command. And it uses Satterthwaite's (1946) df, not Welch's (1947) df. When I use the welch option, I get a different result.

So, I reckon that whoever maintains the t.test command should either change the labeling, or start using the Welch (1947) degrees of freedom. But I look forward to hearing what you useRs think about it! ;-)

More Bruce Weaver's questions See All
Similar questions and discussions