In statistics, Welch's t-test, or unequal variances t-test, is a two-sample location test which is used to test the (null) hypothesis that two populations have equal means. It is named for its creator, Bernard Lewis Welch, and is an adaptation of Student's t-test,[1] and is more reliable when the two samples have unequal variances and possibly unequal sample sizes.[2] [3] These tests are often referred to as "unpaired" or "independent samples" t-tests, as they are typically applied when the statistical units underlying the two samples being compared are non-overlapping. Given that Welch's t-test has been less popular than Student's t-test[2] and may be less familiar to readers, a more informative name is "Welch's unequal variances t-test" — or "unequal variances t-test" for brevity.[3]
Student's t-test assumes that the sample means being compared for two populations are normally distributed, and that the populations have equal variances. Welch's t-test is designed for unequal population variances, but the assumption of normality is maintained.[1] Welch's t-test is an approximate solution to the Behrens–Fisher problem.
Welch's t-test defines the statistic t by the following formula:
t=
\Delta\overline{X | |
s\bar{Xi}={si\over\sqrt{Ni}}
where
\overline{X}i
s\bar{Xi}
ith
si
Ni
\nu
\nu ≈
| ||||||||||||||||||||||||||||||||||||||
|
.
This expression can be simplified when
N1=N2
\nu ≈
s\Delta\bar{X | |
4} |
-1 | |
{\nu | |
1 |
s\bar{X
4 | |
1} |
+
-1 | |
\nu | |
2 |
s\bar{X
4}. | |
2} |
Here,
\nui=Ni-1
The statistic is approximately from the t-distribution since we have an approximation of the chi-square distribution. This approximation is better done when both
N1
N2
Once t and
\nu
The approximate degrees of freedom are real numbers
\left(\nu\inR+\right)
Welch's t-test is more robust than Student's t-test and maintains type I error rates close to nominal for unequal variances and for unequal sample sizes under normality. Furthermore, the power of Welch's t-test comes close to that of Student's t-test, even when the population variances are equal and sample sizes are balanced.[2] Welch's t-test can be generalized to more than 2-samples,[7] which is more robust than one-way analysis of variance (ANOVA).
It is not recommended to pre-test for equal variances and then choose between Student's t-test or Welch's t-test.[8] Rather, Welch's t-test can be applied directly and without any substantial disadvantages to Student's t-test as noted above. Welch's t-test remains robust for skewed distributions and large sample sizes.[9] Reliability decreases for skewed distributions and smaller samples, where one could possibly perform Welch's t-test.[10]
Language/Program | Function | Documentation | |
---|---|---|---|
TTEST(''Data1; Data2; Mode; Type'') | [11] | ||
ttest2(data1, data2, 'Vartype', 'unequal') | [12] | ||
Microsoft Excel pre 2010 (Student's T Test) | TTEST(''array1'', ''array2'', ''tails'', ''type'') | [13] | |
Microsoft Excel 2010 and later (Student's T Test) | T.TEST(''array1'', ''array2'', ''tails'', ''type'') | [14] | |
Accessed through menu | [15] | ||
Origin software | Results of the Welch t-test are automatically outputted in the result sheet when conducting a two-sample t-test (Statistics: Hypothesis Testing: Two-Sample t-test) | [16] | |
Default output from proc ttest (labeled "Satterthwaite") | |||
Python (through 3rd-party library SciPy) | scipy.stats.ttest_ind(''a'', ''b'', ''equal_var=False'') | [17] | |
t.test(data1, data2, var.equal = FALSE) | [18] | ||
ttest2(data1, data2) | [19] | ||
Statistics.Test.StudentT.welchTTest SamplesDiffer data1 data2 | [20] | ||
Oneway(Y(YColumn), X(XColumn), Unequal Variances(1)); | [21] | ||
UnequalVarianceTTest(data1, data2) | [22] | ||
Stata | '''ttest''' ''varname1'' '''==''' ''varname2''''',''' '''welch''' | [23] | |
Google Sheets | TTEST(range1, range2, tails, type) | [24] | |
GraphPad Prism | It is a choice on the t test dialog. | ||
An option in the menu | [25] [26] | ||
GNU Octave | welch_test(x, y) | [27] |