Statistics Quest

Confidence intervals for a difference in means (Welch, pooled, paired)

Intervals for μ₁ − μ₂ from independent samples (Welch by default, pooled when variances are assumed equal) or for the mean difference of paired data.

(xˉ1−xˉ2)±t1−α/2, νs12n1+s22n2,ν=(v1+v2)2v12n1−1+v22n2−1,  vi=si2ni(\xbar_1 - \xbar_2) \pm t_{1-\alpha/2,\,\nu}\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}, \quad \nu = \frac{(v_1 + v_2)^2}{\frac{v_1^2}{n_1-1} + \frac{v_2^2}{n_2-1}},\; v_i = \frac{s_i^2}{n_i}
Welch interval (default): no equal-variance assumption
xˉi,si,ni\xbar_i, s_i, n_i
mean, SD (n−1n - 1) and size of sample ii
ν\nu
Welch–Satterthwaite degrees of freedom (usually not a whole number)
(xˉ1−xˉ2)±t1−α/2, n1+n2−2  sp1n1+1n2,sp2=(n1−1)s12+(n2−1)s22n1+n2−2(\xbar_1 - \xbar_2) \pm t_{1-\alpha/2,\,n_1+n_2-2}\; s_p\sqrt{\frac{1}{n_1} + \frac{1}{n_2}}, \quad s_p^2 = \frac{(n_1-1)s_1^2 + (n_2-1)s_2^2}{n_1+n_2-2}
Pooled interval (assumes equal population variances)
sps_p
pooled standard deviation
dˉ±t1−α/2, n−1 sdn\bar d \pm t_{1-\alpha/2,\,n-1}\,\frac{s_d}{\sqrt{n}}
Paired interval: a one-sample t interval on the differences
di=xi−yid_i = x_i - y_i
difference within pair ii
dˉ,sd\bar d, s_d
mean and SD of the differences
nn
number of pairs

When to use

  • Independent groups (two different sets of units): Welch. It is the engine's default because it stays valid when variances differ and loses almost nothing when they are equal.
  • Pooled: only when equal variances are justified by design or prior knowledge.
  • Paired (same units measured twice, or matched pairs): analyse the differences.

Assumptions

Random samples / random assignment; independence within (and, for two-sample, between) groups; approximately normal data or differences, or reasonably large samples.

How to interpret

The interval gives plausible values for the difference (group 1 − group 2). If it excludes 0, the matching two-sided test rejects "no difference" at that α. Judge the size: is the whole interval practically important?

Common mistakes

  • Treating paired data as independent: the SE ignores the pairing and is usually far too large.
  • Choosing pooled vs Welch after looking at which gives the smaller p-value.
  • Concluding "no difference" because two separate intervals overlap.

Example

Group A: 34, 29, 41, 38, 30, 36 (xˉ=34.67\xbar = 34.67, s=4.633s = 4.633); group B: 27, 31, 25, 29, 24, 28, 26 (xˉ=27.14\xbar = 27.14, s=2.410s = 2.410). Welch 95% interval: (2.60,12.45)(2.60, 12.45) with ν=7.26\nu = 7.26; pooled: (3.12,11.93)(3.12, 11.93) with df 11. Paired example: before 142, 150, 138, 147, 155, 141 and after 136, 146, 135, 140, 150, 139; dˉ=4.5\bar d = 4.5, sd=1.871s_d = 1.871, 95% interval (2.54,6.46)(2.54, 6.46).