AP STATISTICS • INFERENCE FOR QUANTITATIVE DATA: MEANS

Confidence Intervals for the Difference of Two Means

Estimate how far apart two population means truly lie using sample data and the t-distribution.

Historical Context & Motivation

The question of whether two groups genuinely differ is one of the oldest in quantitative science. When a pharmaceutical researcher measures blood-pressure reductions under two drugs, or an agronomist compares crop yields across two fertilizers, the raw difference between sample means is only a starting point—random sampling variability means that difference could be larger, smaller, or even opposite in sign at the population level. The need for a principled interval that captures plausible values of μ₁ − μ₂ drove some of the most important developments in modern statistics.

1908
Student's t-Distribution
William Sealy Gosset, publishing under the pseudonym "Student," derived the t-distribution while working at the Guinness brewery. His work made small-sample inference possible by accounting for the extra uncertainty introduced when the population standard deviation is unknown.
1935
Fisher Formalizes Experimental Design
Ronald Fisher's "The Design of Experiments" established randomization as a cornerstone of comparative studies, providing the logical foundation for two-sample comparisons and the confidence intervals that accompany them.
1938
Welch's Approximate Solution
Bernard Lewis Welch proposed an approximate t-test and associated confidence interval that does not require equal population variances—a major practical advance, since the assumption of equal variances is rarely verifiable and often violated.
1947
Satterthwaite's Degrees of Freedom
Franklin E. Satterthwaite published a general formula for approximating the degrees of freedom of a linear combination of sample variances. His formula underpins the Welch–Satterthwaite degrees of freedom used in every modern statistics course and calculator.

The central question this lesson addresses is: given two independent random samples with means x̄₁ and x̄₂, how do we construct an interval of plausible values for the true difference μ₁ − μ₂, and what conditions must hold for that interval to be trustworthy?

Core Principles & Definitions

Before computing anything, you must internalize the logic that makes a two-sample confidence interval valid. The interval rests on the same point-estimate ± margin-of-error structure you learned for one-sample inference, but the sampling distribution and the conditions that justify it are slightly more complex because two independent sources of variability contribute to the standard error.

1

Point Estimate

The statistic x̄₁ − x̄₂ is an unbiased estimator of the parameter μ₁ − μ₂. It sits at the center of every two-sample confidence interval.
2

Standard Error of the Difference

Because the two samples are independent, their variances add: SE = √(s₁²/n₁ + s₂²/n₂). This quantity measures how much x̄₁ − x̄₂ would fluctuate across repeated sampling.
3

Critical Value from the t-Distribution

We use t* instead of z* because population standard deviations are unknown. The appropriate degrees of freedom come from the Welch–Satterthwaite approximation (or your calculator's built-in formula).
4

Conditions for Validity

Random: both samples must be randomly selected or randomly assigned. Independent: samples are independent of each other, and the 10% condition holds. Normal: both population distributions are approximately normal, or both sample sizes are large enough (n ≥ 30).
5

Interpretation

We are C% confident that the interval captures the true value of μ₁ − μ₂. This means if we repeated the sampling process many times, about C% of the resulting intervals would contain the parameter.
KEY TAKEAWAY
Think of constructing a confidence interval as building a net beneath a tightrope walker. The point estimate (x̄₁ − x̄₂) is the walker's best step, but the margin of error is the net that accounts for the inevitable wobble introduced by sampling variability. Widening the net (increasing confidence level or using smaller samples) makes a catch more likely, but tells you less about exactly where the walker lands.

Visualizing the Sampling Distribution

The diagram below illustrates how two independent sampling distributions combine into a single sampling distribution of the difference. Each sample mean has its own variability; when we subtract them, the variances add (a direct consequence of independence), producing a wider distribution centered at μ₁ − μ₂.

The top two bell curves represent the sampling distributions of x̄₁ and x̄₂ separately. The wider curve at the bottom shows the sampling distribution of the difference x̄₁ − x̄₂, centered at μ₁ − μ₂. The dashed amber rectangle indicates the region captured by a confidence interval.

Notice that the bottom curve is wider than either individual curve. This is a direct visual manifestation of the fact that variances add when random variables are independent. Because two sources of sampling variability contribute, the standard error of the difference is always larger than the standard error of either individual mean, which makes confidence intervals for the difference wider than one-sample intervals of comparable confidence level.

Mathematical Framework

The two-sample t-interval follows the universal structure of a confidence interval: point estimate ± (critical value)(standard error). We now formalize each component.

GENERAL FORM
(x̄₁ − x̄₂) ± t* × √(s₁²/n₁ + s₂²/n₂)
x̄₁, x̄₂ = sample means; s₁, s₂ = sample standard deviations; n₁, n₂ = sample sizes; t* = critical value from the t-distribution at the desired confidence level C.
STANDARD ERROR OF THE DIFFERENCE
SE = √(s₁²/n₁ + s₂²/n₂)
This formula uses the fact that Var(X − Y) = Var(X) + Var(Y) when X and Y are independent. We estimate σ₁² and σ₂² with s₁² and s₂², respectively.
WELCH–SATTERTHWAITE DEGREES OF FREEDOM
df = (s₁²/n₁ + s₂²/n₂)² / [(s₁²/n₁)²/(n₁ − 1) + (s₂²/n₂)²/(n₂ − 1)]
This approximation yields a non-integer df that is always between min(n₁ − 1, n₂ − 1) and n₁ + n₂ − 2. On the AP exam your calculator computes this automatically. A conservative shortcut is to use df = min(n₁ − 1, n₂ − 1).
📝 AP Exam Tip
On the AP Statistics exam, you are expected to use the two-sample t-interval (not the pooled t-interval) unless you are explicitly told that the population variances are equal. When writing free-response answers, always name the procedure ("two-sample t-interval for μ₁ − μ₂"), verify conditions, show the formula with substitution, and interpret the interval in context.

The derivation rests on the Central Limit Theorem: when sample sizes are sufficiently large (or the populations are approximately normal), the distribution of x̄₁ − x̄₂ is approximately normal. Standardizing this quantity by dividing by the estimated standard error produces a statistic that follows an approximate t-distribution with Welch–Satterthwaite degrees of freedom, and the confidence interval follows by inverting the resulting probability statement.

Conditions & Checking Assumptions

A confidence interval is only as trustworthy as its underlying assumptions. On the AP exam, verifying conditions is not optional—failure to state and check them will cost points on every free-response inference question. The three conditions for a two-sample t-interval are commonly summarized by the mnemonic Random, Independent, Normal.

The three conditions—Random, Independent, Normal—must all be verified and stated in your free-response answer. The diagram summarizes what to check and how to phrase each verification.

A subtle but important point: if the data come from a randomized experiment rather than two independent random samples, the Random condition is satisfied by the random assignment of subjects to groups, and the 10% condition is not required because the subjects are the entire population of interest for that experiment. In observational studies, however, both the random selection and the 10% condition must be addressed.

📊 Normality Guidelines by Sample Size
n < 15: Use t-procedures only if the data appear approximately normal with no outliers. 15 ≤ n < 30: t-procedures are acceptable unless there is strong skewness or outliers. n ≥ 30: The Central Limit Theorem ensures approximate normality of the sampling distribution regardless of population shape.

Worked Example

A researcher wants to compare the mean resting heart rates of athletes and non-athletes. She takes a random sample of 35 college athletes and a separate random sample of 40 non-athletes from the same university. The sample statistics are: athletes (Group 1): x̄₁ = 62.4 bpm, s₁ = 8.3 bpm; non-athletes (Group 2): x̄₂ = 71.8 bpm, s₂ = 10.1 bpm. Construct a 95% confidence interval for μ₁ − μ₂.

95% CI for μ₁ − μ₂ (Athletes − Non-Athletes)
1
Step 1 — State the Parameter and ProcedureWe wish to estimate μ₁ − μ₂, the difference in mean resting heart rates between the population of college athletes and the population of college non-athletes. We will use a two-sample t-interval for the difference of two means.
2
Step 2 — Check ConditionsRandom: Both samples were selected randomly from the university population. Independent: The two groups are distinct individuals, and assuming the university has at least 350 athletes and 400 non-athletes, the 10% condition is satisfied for both groups. Normal/Large Sample: n₁ = 35 ≥ 30 and n₂ = 40 ≥ 30, so the Central Limit Theorem ensures the sampling distribution of x̄₁ − x̄₂ is approximately normal.
3
Step 3 — Compute the Standard ErrorSE = √(s₁²/n₁ + s₂²/n₂) = √(8.3²/35 + 10.1²/40) = √(68.89/35 + 102.01/40) = √(1.9683 + 2.5503) = √4.5186 ≈ 2.126.
SE ≈ 2.126
4
Step 4 — Find Degrees of Freedom and t*Using the Welch–Satterthwaite formula: df = (1.9683 + 2.5503)² / [(1.9683)²/34 + (2.5503)²/39] = (4.5186)² / [3.8742/34 + 6.5040/39] = 20.4178 / [0.11395 + 0.16677] = 20.4178 / 0.28072 ≈ 72.73. Using df ≈ 72.73 (or the calculator value) for a 95% confidence level, t* ≈ 1.993. On the AP exam, you would report the calculator's value directly.
df ≈ 72.7, t* ≈ 1.993
5
Step 5 — Construct the Interval(x̄₁ − x̄₂) ± t* × SE = (62.4 − 71.8) ± 1.993 × 2.126 = −9.4 ± 4.237. This gives us a 95% CI of (−13.637, −5.163).
95% CI: (−13.64, −5.16)
6
Step 6 — Interpret in ContextWe are 95% confident that the true difference in mean resting heart rates (athletes minus non-athletes) is between −13.64 bpm and −5.16 bpm. Because the entire interval is negative, we have convincing evidence that, on average, college athletes have lower resting heart rates than college non-athletes. The data suggest athletes' mean heart rate is between about 5 and 14 bpm lower.

Interpretation, Strengths & Common Pitfalls

Correctly interpreting a confidence interval—and avoiding the common misconceptions that appear on the AP exam—is just as important as computing it. The table below contrasts correct interpretations with frequent errors.

Common interpretive errors on AP Statistics free-response questions
AspectCorrectCommon Error
What the interval capturesThe interval estimates the parameter μ₁ − μ₂, the difference in population means.Saying the interval captures the difference in sample means x̄₁ − x̄₂ (the point estimate is known—no interval needed).
Meaning of 95% confidenceIf we repeated the sampling process many times, about 95% of resulting intervals would contain μ₁ − μ₂."There is a 95% probability that μ₁ − μ₂ is in this interval." (The parameter is fixed; probability applies to the procedure, not the parameter.)
When 0 is in the intervalZero is a plausible value for μ₁ − μ₂, so we lack convincing evidence of a difference."The means are equal." (Failure to find evidence of a difference ≠ evidence that there is no difference.)
CausationCausal language is appropriate only when data come from a randomized experiment.Claiming causation from an observational study (e.g., "exercising causes lower heart rate").
ContextAlways interpret in terms of the real-world variables and units (e.g., bpm, kg, minutes).Giving a generic statement like "We are 95% confident the difference is between −13.64 and −5.16" without naming the variable or units.
KEY TAKEAWAY
Think of the confidence level as describing the reliability of the manufacturing process, not the product. A factory that produces 95% defect-free widgets does not guarantee any single widget is good; similarly, 95% confidence means the method works 95% of the time, not that any single interval has a 95% probability of being correct.

Connection to Hypothesis Tests & Paired Designs

The two-sample t-interval is intimately connected to the two-sample t-test: a 95% confidence interval that does not contain 0 corresponds exactly to rejecting H₀: μ₁ − μ₂ = 0 at the α = 0.05 significance level. However, the interval provides more information than a simple reject/fail-to-reject decision—it tells you the range of plausible effect sizes. Understanding this duality is essential for the AP exam and for real statistical practice.

Comparison of two-sample and paired t-intervals
FeatureTwo-Sample t-IntervalPaired t-Interval
Data structureTwo independent groups with potentially different sample sizes.Each subject measured twice, or subjects are matched in pairs.
Parameterμ₁ − μ₂μ_d (mean of the differences)
Standard error√(s₁²/n₁ + s₂²/n₂)s_d / √n, where s_d is the SD of the differences
Degrees of freedomWelch–Satterthwaite approximation (calculator computes)n − 1, where n = number of pairs
When to useSubjects in the two groups have no natural pairing.Pre/post designs, matched pairs, or repeated measures.
Key advantageFlexible; does not require equal sample sizes or equal variances.Eliminates subject-to-subject variability, producing a narrower interval.

Looking ahead, in college statistics courses you will encounter ANOVA (analysis of variance), which generalizes the two-sample comparison to three or more groups simultaneously, and bootstrap confidence intervals, which use resampling to avoid distributional assumptions entirely. These methods build directly on the logic and structure of the two-sample t-interval you are learning here, so mastering this procedure establishes a foundation for more advanced inference.

Practice Problems

1
A 90% confidence interval for μ₁ − μ₂ is (−3.2, 1.8). Which of the following is the best interpretation?
2
Two independent random samples yield: Group 1: n₁ = 25, x̄₁ = 48.0, s₁ = 6.0; Group 2: n₂ = 30, x̄₂ = 43.0, s₂ = 7.0. What is the standard error of x̄₁ − x̄₂?
3
A researcher constructs a 95% confidence interval for the difference in mean test scores between School A and School B: (2.1, 8.7). Later she decides she wants a 99% confidence interval from the same data. Compared to the 95% interval, the 99% interval will:
PROBLEM 4APPLIED
An environmental scientist randomly selects 20 water samples from River A and 22 water samples from River B to compare dissolved oxygen levels (mg/L). The data yield: River A: x̄₁ = 8.7 mg/L, s₁ = 1.4 mg/L, n₁ = 20. River B: x̄₂ = 7.9 mg/L, s₂ = 1.8 mg/L, n₂ = 22. Dotplots of both samples show roughly symmetric distributions with no outliers. (a) Construct a 95% confidence interval for μ₁ − μ₂. (b) Based on the interval, is there convincing evidence that the mean dissolved oxygen levels differ between the two rivers? Explain.
PROBLEM 5CRITICAL THINKING
A psychologist designs a study to compare the effects of two sleep interventions on reaction time (ms). She has 50 volunteers. Design A: Randomly assign 25 volunteers to Intervention 1 and 25 to Intervention 2. Measure each person's reaction time once and use a two-sample t-interval. Design B: Have all 50 volunteers try both interventions in random order (with a washout period). Record reaction times under both conditions for each person and use a paired t-interval. (a) Explain why Design B is likely to produce a narrower confidence interval than Design A, even though it uses the same volunteers. (b) Under what circumstances might Design A be preferred despite producing a wider interval? (c) A colleague suggests pooling the standard deviations in Design A by assuming σ₁ = σ₂. What is the risk of this assumption, and how does the Welch (unpooled) procedure protect against it?

Lesson Summary

A two-sample t-interval estimates the difference in population means μ₁ − μ₂ using the formula (x̄₁ − x̄₂) ± t* × √(s₁²/n₁ + s₂²/n₂). The standard error reflects the combined sampling variability from both groups, and the Welch–Satterthwaite degrees of freedom provide the correct t* critical value without assuming equal population variances. Before constructing the interval, verify the three conditions: Random (random sampling or random assignment), Independent (separate groups and the 10% condition), and Normal/Large Sample (population normality or n ≥ 30).

When interpreting, state what you are confident about—the parameter, not the statistic—and always include context (variable names and units). If the interval contains 0, there is no convincing evidence of a difference. If it does not contain 0, the sign of every value in the interval tells you which population mean is likely larger. This procedure connects directly to the two-sample t-test, the paired t-interval, and the broader ANOVA framework you will encounter in later coursework.

Varsity Tutors • AP Statistics • Confidence Intervals for the Difference of Two Means