A Confidence Interval for a Difference in Means
How to estimate μ₁ − μ₂ from two independent samples or a randomized experiment with a two-sample t-interval: the parameter, the conditions for both samples, the standard error, degrees of freedom, and margin of error.
To compare the means of two separate groups, estimate \(\mu_1 - \mu_2\) with \(\bar{x}_1 - \bar{x}_2\). The margin of error combines both samples’ variability: \(t^*\sqrt{s_1^2/n_1 + s_2^2/n_2}\). The procedure is the two-sample t-interval for the difference between population means. Its critical value uses degrees of freedom from technology, or the conservative smaller \(n - 1\).
1The parameter
Define \(\mu_1 - \mu_2\) in context: the difference in the means, the response variable, and both populations (or treatments), with the order of subtraction. Use this procedure for two independent samples. If each value in one group is paired with a value in the other, analyze the differences with a one-sample interval instead.
Before-and-after scores from the same students are not independent samples. A two-sample interval ignores the pairing; a one-sample interval on the differences uses it.
2Conditions
| Condition | Check |
|---|---|
| Randomization | Two independent random samples, or a randomized experiment |
| 10% condition | \(n_1 \le 10\%N_1\) and \(n_2 \le 10\%N_2\) when sampling without replacement (not needed for an experiment) |
| Sample data | Both \(n_1 \ge 30\) and \(n_2 \ge 30\), or both populations approximately normal. If either sample is under 30, both samples’ data should be free from strong skewness and outliers |
The sample data condition is about both groups. With samples of 10 and 10, look at a graph of each one, and say what each shows.
3The calculation
The point estimate is \(\bar{x}_1 - \bar{x}_2\). The margin of error is \(t^*\) times the standard error. \(t^*\) is the critical value for the central C% of a t-distribution whose degrees of freedom come from technology; they fall between the smaller of \(n_1 - 1\) and \(n_2 - 1\) and \(n_1 + n_2 - 2\).
\(\sqrt{8.4^2/40 + 6.1^2/45} \approx 1.61\), not \(8.4 + 6.1 = 14.5\) or \(\dfrac{8.4}{\sqrt{40}} + \dfrac{6.1}{\sqrt{45}}\). Square, divide, add, then take the square root.
Two fertilizers
Without technology for df, what interval would you get for the fertilizer data, and how does it compare?
- 1Use the smaller of \(n_1 - 1\) and \(n_2 - 1\): df = 9, \(t^* = 2.262\).
- 2\(2.1 \pm 2.262(0.573) = (0.80,\ 3.40)\).
- 3The true df lies between 9 (the smaller \(n - 1\)) and 18 (\(n_1 + n_2 - 2\)); technology gives 17.8.
4Start to finish
Commute times
Independent random samples of 40 students at School A (1,200 students) and 45 at School B (900 students) gave mean commute times of 24.6 and 18.7 minutes, with standard deviations 8.4 and 6.1 minutes. Construct a 95% confidence interval for the difference in mean commute times.
- 1State. \(\mu_A - \mu_B\), where \(\mu_A\) and \(\mu_B\) are the true mean commute times (minutes) of all students at School A and School B. 95% confidence.
- 2Plan. Two-sample t-interval for a difference between population means. Randomization: independent random samples. 10% condition: 40 ≤ 120 and 45 ≤ 90. Sample data condition: both samples have at least 30.
- 3Do. Point estimate \(24.6 - 18.7 = 5.9\). \(SE = \sqrt{8.4^2/40 + 6.1^2/45} \approx 1.610\). Technology gives df ≈ 70.4 and \(t^* \approx 1.994\), so \(ME \approx 3.21\). Interval: \((2.69,\ 9.11)\).
- 4Conclude. We are 95% confident that the interval from 2.69 to 9.11 minutes captures the true difference in mean commute times (School A minus School B) for all students at the two schools.
Two fertilizers
Twenty seedlings were randomly assigned to fertilizer A or B, 10 each. Heights after 4 weeks (cm): A: 24.1, 26.3, 22.8, 25.5, 27.0, 23.9, 25.2, 26.8, 24.6, 25.8; B: 22.4, 23.9, 21.7, 24.8, 22.1, 23.0, 25.1, 21.9, 23.6, 22.5. Construct a 95% interval for \(\mu_A - \mu_B\).
- 1Parameter: the true difference in mean height after 4 weeks (A minus B) for seedlings like these.
- 2Randomization: treatments randomly assigned, so the 10% condition does not apply. Sample data: both groups have 10, and neither dotplot shows strong skewness or outliers (Figure 1).
- 3\(\bar{x}_A = 25.2\), \(s_A \approx 1.35\); \(\bar{x}_B = 23.1\), \(s_B \approx 1.20\). \(SE \approx 0.573\), df ≈ 17.8, \(t^* \approx 2.103\), \(ME \approx 1.20\).
- 4Interval: \(2.1 \pm 1.20 = (0.90,\ 3.30)\).
STAT, TESTS, 2-SampTInt. With summary numbers choose Inpt: Stats and enter \(\bar{x}_1\), \(s_1\), \(n_1\), \(\bar{x}_2\), \(s_2\), \(n_2\); with data, choose Data and name the two lists. C-Level 0.95, Pooled: No. For the commute data the output is (2.69, 9.11) with df = 70.4.
“We are 95% confident that the interval from 2.69 to 9.11 minutes captures the true difference in mean commute times (School A minus School B) for all students at the two schools.”
(2.69, 9.11) means School A’s mean is larger. Reversed, the interval is (−9.11, −2.69), with the same meaning. Name the order in the parameter and in the conclusion.
Quick reference
| Piece | Formula or rule |
|---|---|
| Parameter | \(\mu_1 - \mu_2\), with the order stated |
| Point estimate | \(\bar{x}_1 - \bar{x}_2\) |
| Standard error | \(\sqrt{s_1^2/n_1 + s_2^2/n_2}\) |
| Degrees of freedom | From technology; conservative choice: smaller of \(n_1 - 1\), \(n_2 - 1\) |
| Interval | \((\bar{x}_1 - \bar{x}_2) \pm t^* \cdot SE\) |
| Calculator | 2-SampTInt, Pooled: No |