Worked two-group stress test

Welch vs Student's t test: do not let a variance pre-test choose.

Both tests compare two independent means. Welch keeps each group's variance separate; pooled Student assumes one common population variance. When sample size and variance are both unequal, that assumption can reverse the inferential answer.

24 raw values2 independent groups2 variance models9-minute read

The short answer

Use Welch unless a common variance was justified in advance.

Welch's two-sample t test directly estimates the uncertainty of the mean difference from each group's own variance. The pooled Student test gains efficiency only under the stronger model that both populations share one variance. R therefore uses Welch by default for an unpaired two-sample t.test.

Do not use a preliminary variance test as a switch: failing to reject equal variances does not establish that the variances are equal. Pre-specify Welch, or document the scientific basis for a common-variance model before inspecting the sample SDs.

A transparent stress test, not a biological dataset

These 24 synthetic values were designed to isolate one mechanism: the smaller group has lower spread, while the larger group has higher spread. Every value is shown, the distributions are symmetric, and no biological conclusion is attached to them.

Row Smaller low-variance group Larger high-variance group
1 9.0 3.5
2 9.5 4.5
3 9.8 5.0
4 10.2 5.5
5 10.5 6.0
6 11.0 6.5
7 7.0
8 7.4
9 7.7
10 8.3
11 8.6
12 9.0
13 9.5
14 10.0
15 10.5
16 11.0
17 11.5
18 12.5
Raw values and standard deviations in two groups Six tightly clustered values have mean ten. Eighteen widely spread values have mean eight. Horizontal lines mark means and vertical bars mark one standard deviation. 4 6 8 10 12 Observed value n=6 · mean 10 · SD 0.718 n=18 · mean 8 · SD 2.554
The larger sample is also the noisier sample. This coupling—not unequal variance alone—is what makes the pooled standard error especially misleading here.

Welch keeps both variance contributions visible

The observed mean difference is 10 − 8 = 2.000. Welch estimates its standard error without pooling:

SE = √(s₁²/n₁ + s₂²/n₂) = √(0.516/6 + 6.524/18) = 0.66964

The result is t = 2.9867 with Welch–Satterthwaite df = 21.843, P = 0.006836, and a 95% confidence interval for the mean difference of 0.6107 to 3.3893.

Pooling spends the high-variance sample three times

Student's equal-variance model combines the sample variances into sₚ² = 5.1582, or sₚ = 2.2712. The larger, high-variance group contributes 17 residual degrees of freedom to that pool; the smaller, low-variance group contributes only 5.

SEpooled = √[5.1582 × (1/6 + 1/18)] = 1.07064

The pooled result is t = 1.8680, df = 22, P = 0.07513, with a 95% interval of −0.2204 to 4.2204. The estimated difference did not change; only the variance model did.

This is not permission to choose the smaller P value. Welch is the primary result because its variance model was selected before comparing results. A different dataset can make Welch more conservative than pooling.

Why an F test should not act as a traffic light

This stress test gives a variance-ratio F = 12.6425 and P = 0.01073. That describes strong sample evidence against a common variance, but the test did not create Welch's validity. Conversely, a non-significant variance test would not prove equal population variances—especially in small samples where such a pre-test has little power.

A two-stage rule also makes the final procedure depend on another random P value. Peer-reviewed guidance recommends specifying Welch directly rather than conditionally switching after a variance test. If a common variance is scientifically justified, state that model and its rationale; do not infer it from “P > 0.05.”

What if both groups have the same n?

With equal sample sizes, the Welch and pooled formulas produce the same t statistic even when sample variances differ; their reference degrees of freedom can still differ. Severe distortion is most likely when variance and sample size are both unequal, particularly when the smaller group has the smaller variance or vice versa.

What Welch does not repair

  • It does not make paired or repeated measurements independent.
  • It does not identify the experimental unit or repair pseudoreplication.
  • It does not neutralize severe skew, influential outliers or tiny samples.
  • It does not correct a family of many unplanned comparisons.
  • It still answers a question about means, not medians or entire distributions.

Inspect every point and the study design. A non-significant normality test cannot confirm a Gaussian population, just as a non-significant variance test cannot confirm equal SDs.

A compact reporting template

“The two independent group means were compared using a pre-specified two-sided Welch t test, without assuming equal population variances. The smaller group had n = 6, mean = 10.0 and SD = 0.718; the larger group had n = 18, mean = 8.0 and SD = 2.554. The estimated mean difference was 2.00 (95% CI 0.61 to 3.39), t(21.84) = 2.99, P = 0.0068.”

What Plotwright checks

Plotwright sends all 24 values to its production unpaired-t engine. The executable gate independently derives both standard errors from the displayed means, SDs and sample sizes, checks both t statistics and confidence intervals, and compares both variants with SciPy's independent implementation.

The sample opens with Welch pre-selected. Plotwright also displays the pooled result for auditability, but its checklist no longer treats a non-significant variance test as evidence that pooling is appropriate.

Synthetic-data caveat: this deliberately constructed sample is a numerical stress test, not evidence for a treatment, biomarker or biological effect.

Sources and reproducibility

  1. R stats documentation: t.test—Welch is the default two-sample variance model; pooling requires var.equal = TRUE.
  2. NIST/SEMATECH: two-sample t test—separate-variance and pooled standard errors plus the Welch–Satterthwaite degrees of freedom.
  3. West (2021): use the Welch t test when comparing two groups—peer-reviewed clinical-science guidance against choosing via a preliminary variance test.
  4. Plotwright statistical validation—expected values, executable anchors and evidence limits.

Keep raw values, variance models and intervals together.

Plotwright opens all 24 values, Welch pre-selected, the pooled audit result and an editable column graph in one project.