Welch interval

Definition taught in Estimation examples, part of Data analysis

Welch interval

Type Definition
Taught in Estimation examples
Part Data analysis
Worked examples 2

For independent normal samples of sizes n_1 and n_2 with sample variances s_X^2 and s_Y^2, the Welch interval for \mu_X-\mu_Y with approximate confidence 1-\alpha is

\overline x-\overline y\pm t_{\mathrm{df};\,1-\alpha/2}\sqrt{\frac{s_X^2}{n_1}+\frac{s_Y^2}{n_2}}, \qquad \mathrm{df}=\frac{\bigl(s_X^2/n_1+s_Y^2/n_2\bigr)^2}{\dfrac{(s_X^2/n_1)^2}{n_1-1}+\dfrac{(s_Y^2/n_2)^2}{n_2-1}}.

The degrees of freedom are the Welch–Satterthwaite approximation.

Examples

First- and third-year weights

Worked example from Estimation examples

15 first-year students have mean weight 62.0 kg and standard deviation 15 kg; 10 third-year students have mean 71.5 kg and standard deviation 12 kg.

Question. Give a 95% interval for the difference in mean weights without assuming equal variances.

Solution. The standard error is \sqrt{15^2/15+12^2/10}=5.422, and the effective degrees of freedom are 22.10, so t_{22.10;0.975}=2.073. The interval is

-9.5\pm2.073\times5.422=(-20.74,\ 1.74).

It contains 0, so the data do not show a difference in mean weight. The pooled interval, which assumes equal variances, is (-21.24,\ 2.24) on 23 degrees of freedom, a little wider here because the larger sample has the larger variance. With the raw data, t.test(x, y) gives the Welch interval, R’s default, and t.test(x, y, var.equal = TRUE) the pooled one.

Alice’s caffeine test

Worked example from Testing examples

The heart-rate changes in Alice’s caffeine experiment were 17, 22, 21, 16, 6, −2, 27, 15, 16, 20 for the caffeinated group and 4, 10, 7, −9, 5, 4, 5, 7, 6, 12 for decaf.

Question. Is there evidence that caffeine increases the heart rate?

Solution. Model the two groups as independent normal samples with means \mu_1 (caffeinated) and \mu_2 (decaf), and test H_0:\mu_1=\mu_2 against H_1:\mu_1>\mu_2.

caf   <- c(17, 22, 21, 16, 6, -2, 27, 15, 16, 20)
decaf <- c(4, 10, 7, -9, 5, 4, 5, 7, 6, 12)
t.test(caf, decaf, alternative = "greater")
# t = 3.3752, df = 15.74, p-value = 0.001966
t.test(caf, decaf, alternative = "greater", var.equal = TRUE)$p.value   # 0.001686

The difference in means is 10.7 beats per minute. R’s default is the Welch test, with 15.7 effective degrees of freedom and p-value 0.002; the pooled two-sample t test gives p=0.0017. Either way, a difference this large would be very unlikely without an effect of caffeine. Because the drink was assigned at random, the evidence is evidence that caffeine raises the heart rate, for people like Alice’s friends. The two-sided 95% Welch interval for the effect is (4.0,\ 17.4) beats per minute: an effect is clear, its size is not pinned down.

Used in

See also

Sample variance and standard deviation · Margin of error

Glossary and index