Welch's t-test
Welch’s t-test (Welch, 1947) is a version of the independent samples t-test that drops the equal-variances assumption. R uses it by default in t.test(), and SPSS prints it as the “equal variances not assumed” row.
How it differs from Student’s t-test
| Student’s t-test | Welch’s t-test | |
|---|---|---|
| Variances | Pooled into one estimate | Each group’s used separately |
| Standard error | sp √(1/n₁ + 1/n₂) | √(s₁²/n₁ + s₂²/n₂) |
| Degrees of freedom | n₁ + n₂ − 2 | Welch-Satterthwaite formula (usually not a whole number) |
| Assumes equal variances? | Yes | No |
The Welch-Satterthwaite df shrink towards the smaller or more variable group, making the test appropriately cautious when one group is less informative.
Should Welch’s be the default?
Many methodologists say yes (Delacre, Lakens & Leys, 2017). When variances really are equal, Welch’s test performs almost exactly like Student’s. When they aren’t, especially with unequal group sizes, Student’s test can give false positives far more often than α promises, and Welch’s doesn’t. Testing for equal variances first and then choosing is also imperfect, because the variance test itself can be wrong.
Analytika takes the check-first route, consistent with how most courses teach it. It runs a Brown-Forsythe test and uses Welch’s whenever variances appear unequal or can’t be checked.
Worked example: petal length in two iris species
Fisher’s famous iris dataset (built into R) has flower measurements for 50 plants of each of three species. Does petal length differ between setosa and versicolor?
Step 1: describe and check
- Setosa: mean 1.46 cm, SD 0.17. Versicolor: mean 4.26 cm, SD 0.47.
- The SDs differ by almost a factor of three. Brown-Forsythe test: F = 30.50, p < .001, so the variances are unequal.
- The residuals pass the normality check, and there are 50 plants per group.
Analytika therefore chooses Welch’s t-test.
Step 2: run the test
Group 1 (setosa): mean=1.4620, n=50, sd=0.1737 Group 2 (versicolor): mean=4.2600, n=50, sd=0.4699 T-statistic: -39.4927 P-value: 9.934e-46 Cohen's d: -7.8985 df: 62.1398 95% CI: [-9.0670, -6.7239] Mean difference: -2.7980 Difference CI (95%): [-2.9396, -2.6564] Rows excluded for missing values: 0 of 100
> t.test(Petal.Length ~ Species, data = ir)
Welch Two Sample t-test
data: Petal.Length by Species
t = -39.493, df = 62.14, p-value < 2.2e-16
95 percent confidence interval:
-2.939618 -2.656382
sample estimates:
mean in group setosa mean in group versicolor
1.462 4.260The same t, df and confidence interval. Analytika reports group 1 − group 2 (setosa − versicolor), hence the negative signs.
Step 3: interpret
- Versicolor petals are on average 2.80 cm longer, 95% CI [2.66, 2.94], p < .001.
- Cohen’s d = −7.90. This is an enormous effect: the two species barely overlap at all on this measurement. Effects this size are rare outside clear-cut biological differences.
- The df dropped from 98 (Student’s) to 62.14, reflecting the unequal variances.
Here, with equal group sizes, Student’s t-test gives the identical t (−39.49), just with 98 df. The two tests matter most when group sizes and variances both differ. In that situation they can disagree substantially, and Welch’s is the one to trust.
Step 4: report it (APA 7)
Because group variances were unequal, a Welch’s t-test was used. Versicolor petals (M = 4.26, SD = 0.47) were longer than setosa petals (M = 1.46, SD = 0.17), t(62.14) = −39.49, p < .001, d = −7.90, 95% CI [−9.07, −6.72].
How to run it
- SPSS: Independent-Samples T Test, then read the “Equal variances not assumed” row.
- R:
t.test(y ~ group, data = df). Welch’s is the default. - Python:
scipy.stats.ttest_ind(a, b, equal_var=False) - Analytika: picks Welch’s automatically when the variance check fails.
For three or more groups with unequal variances, the equivalent is Welch’s ANOVA. See one-way ANOVA and homogeneity of variance.
References
- Delacre, M., Lakens, D., & Leys, C. (2017). Why psychologists should by default use Welch’s t-test instead of Student’s t-test. International Review of Social Psychology, 30(1), 92–101.
- Welch, B. L. (1947). The generalization of “Student’s” problem when several different population variances are involved. Biometrika, 34(1–2), 28–35.
More in Comparing groups
Try it with the free tools
Run this on your own data
Upload a dataset and ask your question in plain English. Analytika checks the assumptions, picks the test, runs it, and writes the results up in APA format.