From the free course AP Statistics on Lykke
4.7 Constructing a Confidence Interval for the Difference Between Two Population Means
Key concepts: Two-sample t-interval — estimating μ₁ − μ₂ from independent samples · Point estimate x̄₁ − x̄₂, plus or minus a margin of error · Standard error √(s₁²/n₁ + s₂²/n₂) — sample SDs stand in for σ · Margin of error = t* × standard error · Degrees of freedom from technology, not n₁ + n₂ · Independent samples versus paired data — different procedures
The two-sample $t$-interval for the difference between two population means estimates the unknown difference $\mu_1 - \mu_2$ using data from two independent groups.
The two-sample $t$-interval for the difference between two population means estimates the unknown difference $\mu_1 - \mu_2$ using data from two independent groups. Unlike paired data, where observations are linked in couples, this procedure applies when the two samples are selected separately from their respective populations or when experimental units are randomly assigned to two distinct treatment groups. The point estimator for this interval is the difference in sample means, $\bar{x}_1 - \bar{x}_2$.
4.7.1 Identifying the Correct Procedure (Skill 2.C)
Before calculation, a researcher must determine if the study design supports a two-sample $t$-procedure. This requires distinguishing between independent samples and paired data. In independent samples, there is no inherent relationship between an individual in the first group and an individual in the second. For example, comparing the mean test scores of students in California to those in New York involves independent samples. If the same students were tested twice (pre-test and post-test), a paired $t$-interval (Topic 4.2) would be required instead.
Definition: Two-Sample $t$-Interval for $\mu_1 - \mu_2$ An interval used to estimate the difference between the means of two independent populations, calculated as: $$(\bar{x}_1 - \bar{x}_2) \pm t^* \sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}$$
4.7.2 Verifying Necessary Conditions (Skill 4.E)
The validity of the confidence interval depends on three specific conditions. If these are not met, the resulting margin of error and capture rate may be unreliable.
- Randomness: Data must come from two independent random samples or a randomized experiment with two treatment groups.
- Independence (10% Rule): When sampling without replacement from finite populations, each sample size ($n_1$ and $n_2$) must be less than 10% of its respective population size ($N_1$ and $N_2$) to ensure the standard deviation formula remains valid.
- Normality (Large Counts): For each group, the population distribution must be approximately normal, or the sample size must be large ($n \ge 30$). If the sample size is small and the population shape is unknown, the data must not show strong skewness or outliers.
4.7.3 The Mechanics of Construction (Skill 3.E)
The interval is built by adding and subtracting a margin of error from the difference in sample means. The margin of error consists of a critical value ($t^*$) multiplied by the standard error of the difference between the means.
Standard Error and Critical Values
The standard error ($SE_{\bar{x}_1 - \bar{x}2}$) accounts for the variability in both samples: $$SE{\bar{x}_1 - \bar{x}_2} = \sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}$$ The critical value $t^*$ is determined by the desired confidence level and the degrees of freedom ($df$). While statistical software uses the complex Satterthwaite approximation to calculate $df$, a conservative manual approach is to use the smaller of $n_1 - 1$ or $n_2 - 1$.
4.7.4 Contextual Example: Agricultural Yield
An agronomist wants to estimate the difference in mean yield (in bushels per acre) between two varieties of corn. Variety A is planted in 35 plots ($\bar{x}_A = 162, s_A = 12$), and Variety B is planted in 40 plots ($\bar{x}_B = 155, s_B = 15$).
To construct a 95% confidence interval:
- Check Conditions: Both $n_A, n_B \ge 30$, satisfying the Large Counts condition. Random assignment to plots is assumed.
- Calculate Standard Error: $\sqrt{\frac{12^2}{35} + \frac{15^2}{40}} \approx \sqrt{4.11 + 5.625} \approx 3.12$.
- Find $t^*$: Using $df = 35 - 1 = 34$, the $t^*$ for 95% confidence is approximately 2.032.
- Construct Interval: $(162 - 155) \pm 2.032(3.12) \rightarrow 7 \pm 6.34 \rightarrow (0.66, 13.34)$.
Interpretation: We are 95% confident that the interval from 0.66 to 13.34 bushels per acre captures the true difference in the mean yield between Variety A and Variety B ($\mu_A - \mu_B$).
4.7.5 Misconception Check: Standard Deviation vs. Standard Error
A common error is to use the population standard deviation ($\sigma$) or to simply average the two sample standard deviations. In practice, we rarely know $\sigma$, so we must use the sample standard deviations ($s_1$ and $s_2$) to estimate the variability. Furthermore, variances (the squares of the standard deviations) are additive when combining independent random variables, which is why we square the standard deviations and divide by $n$ before taking the square root.
Retrieval Check: A researcher calculates a 90% confidence interval for the difference in mean heights between two species of shrubs to be $(1.2, 4.5)$ centimeters. What is the correct interpretation of this interval? Answer: We are 90% confident that the interval from 1.2 cm to 4.5 cm captures the true difference in the population mean heights of these two species of shrubs, not individual observations or sample statistics.

Source Materials
Study AP Statistics on Lykke
This course page is free to open: signed out, you can read its first two sections, and signing in, on any plan, opens the rest. The free Lykke Chrome extension syncs your own Canvas courses, so ChatGPT, Claude and Muse can answer from your classes and deadlines. It only reads Canvas.
Add the free extensionSign in to open every section