Skip to content
Mean comparisons

Welch's t-test

Compare a continuous outcome between exactly two independent groups without assuming equal variances.

All methods

Requirements

  • continuous outcome
  • one two-level group
  • independent observations

Avoid when

  • paired/repeated observations
  • three or more groups
  • strong ordinal/non-normal outcome with small n

Formula

t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂)

Interpretation

Reports the mean difference, t statistic, p-value, and confidence interval.

Example use case

Compare mean blood pressure between two independent treatments with unequal variances.

Open example datasets

A worked example

Synthetic data, two independent groups, six observations each. Question: how much does the mean score differ? This is a read-only example, not a calculation on your data.

Synthetic group scores
GroupScoresMean
A10, 12, 11, 13, 12, 1412
B14, 15, 13, 16, 15, 1715

B − A = 3.00 points; 95% confidence interval 1.18 to 4.82. Two-sided Welch t-test: t = 3.674, df = 10, p = 0.0043. All 12 observations are analyzed; none are missing or excluded.

Group B averages 3 points higher in this sample. The interval describes uncertainty in the population mean difference under the model assumptions, not the range of individual scores. The test does not establish causation or practical importance. With six observations per group, distributional assumptions deserve particular care. Verified with SciPy's Welch test; use this example as orientation, not a validation certificate.