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.

A scatter plot with data columns and a percentage symbol.
Inside this lesson 10 sections 5 questions 7 figures

SECTION 1

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?

SECTION 2

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.

SECTION 3

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 μ₁ − μ₂.

From Individual Sampling Distributions to the DifferenceSampling Dist. of x̄₁μ₁Sampling Dist. of x̄₂μ₂⟶ Subtract ⟶Sampling Dist. of x̄₁ − x̄₂μ₁ − μ₂SE = √(σ₁²/n₁ + σ₂²/n₂)CI width
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.

SECTION 4

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ˉ1−xˉ2)±t∗×√(s12/n1+s22/n2)(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=√(s12/n1+s22/n2)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=(s12/n1+s22/n2)2/[(s12/n1)2/(n1−1)+(s22/n2)2/(n2−1)]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.

SECTION 5

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.

Conditions Checklist: Two-Sample t-IntervalRRandom• Both samples are obtained via random sampling or random assignment.• State the sampling method for each group explicitly.Example: "The 40 participants were randomly assigned to Treatment or Control."IIndependent• The two samples are independent of each other (no pairing or matching).• 10% condition: each nᵢ is less than 10% of the corresponding population.Check: n₁ < 0.10 × N₁ AND n₂ < 0.10 × N₂NNormal / Large Sample• Both population distributions are approximately normal, OR• Both sample sizes are large (n₁ ≥ 30 and n₂ ≥ 30) so CLT applies.• For small samples, check dotplots/boxplots for strong skew or outliers.If 15 ≤ n < 30: OK unless there is strong skew or outliers.
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.

SECTION 6

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. 1

    Step 1 — State the Parameter and Procedure

    We 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. 2

    Step 2 — Check Conditions

    Random: 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. 3

    Step 3 — Compute the Standard Error

    SE = √(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. 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. 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. 6

    Step 6 — Interpret in Context

    We 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.

SECTION 7

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.

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.

Common interpretive errors on AP Statistics free-response questions

✦

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.

SECTION 8

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.

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₂)sds_d / √n, where sds_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.

Comparison of two-sample and paired t-intervals

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.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

A 90% confidence interval for μ₁ − μ₂ is (−3.2, 1.8). Which of the following is the best interpretation?
  • A. There is a 90% probability that μ₁ − μ₂ is between −3.2 and 1.8.
  • B. We are 90% confident that the true difference in population means is between −3.2 and 1.8.
  • C. 90% of all possible sample differences fall between −3.2 and 1.8.
  • D. The sample means differ by an amount between −3.2 and 1.8.
  • E. We are 90% confident that the difference in sample means is between −3.2 and 1.8.
Show answer (B)
B is correct. A confidence interval estimates the parameter (μ₁ − μ₂), not the statistic or individual observations. Choice A is wrong because confidence is a property of the procedure, not a probability statement about the fixed parameter. Choice C incorrectly describes the interval as capturing sample differences rather than the population parameter. Choice D is wrong because x̄₁ − x̄₂ is a single known value, not a range. Choice E makes the same error as D—the interval targets population means, not sample means. Because 0 is contained in (−3.2, 1.8), we lack convincing evidence that μ₁ ≠ μ₂ at the 10% significance level.

Question 2: BASIC CALCULATION

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̄₂?
  • A. 1.44
  • B. 1.76
  • C. 2.07
  • D. 3.07
  • E. 3.63
Show answer (B)
SE = √(s₁²/n₁ + s₂²/n₂) = √(36/25 + 49/30) = √(1.44 + 1.6333) = √3.0733 ≈ 1.753, which rounds to 1.76 (choice B). Choice A (1.44) is just s₁²/n₁ without adding the second term. Choice C (2.07) results from incorrectly using (s₁ + s₂)/√(n₁ + n₂). Choice D (3.07) is the sum 1.44 + 1.63 before taking the square root. Choice E (3.63) is √(s₁² + s₂²) without dividing by sample sizes. Remember: variances add (then take the square root), but each variance must first be divided by its sample size.

Question 3: INTERMEDIATE

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:
  • A. Be narrower and have the same center.
  • B. Be wider and have the same center.
  • C. Be wider and have a different center.
  • D. Have the same width but a shifted center.
  • E. Possibly contain 0, since the additional width could shift the lower bound below 0.
Show answer (B)
B is correct. Increasing the confidence level raises the critical value t*, which increases the margin of error while the point estimate x̄₁ − x̄₂ (the center) remains unchanged. Choice A reverses the relationship—higher confidence means a wider, not narrower, interval. Choice C is wrong because only the margin of error changes, not the center. Choice D is wrong for the same reason—the center is fixed at x̄₁ − x̄₂. Choice E describes something that is possible in principle (the wider 99% interval might include 0), but the wording incorrectly suggests the width "shifts" the lower bound, when in fact the interval expands symmetrically around the same center. The actual 99% interval would indeed be wider and still centered at (2.1 + 8.7)/2 = 5.4.

Question 4: APPLIED

4 pts
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.
Show answer
Rubric (4 points): Point 1 — State parameter and check conditions (1 pt): The parameter is μ₁ − μ₂, the difference in mean dissolved oxygen levels between the populations of all water samples from River A and River B. Random: Both samples are stated to be randomly selected. Independent: The samples are from different rivers and are independent of each other; assuming each river has far more than 200 or 220 possible sample locations, the 10% condition is met. Normal: Both sample sizes are between 15 and 30, and the dotplots show roughly symmetric distributions with no outliers, so the t-procedures are appropriate. Point 2 — Compute SE and df (1 pt): SE = √(1.4²/20 + 1.8²/22) = √(1.96/20 + 3.24/22) = √(0.098 + 0.14727) = √0.24527 ≈ 0.4953. Calculator gives df ≈ 38.9. Using df ≈ 38.9, t* for 95% confidence ≈ 2.023. Point 3 — Construct the interval (1 pt): (x̄₁ − x̄₂) ± t* × SE = (8.7 − 7.9) ± 2.023 × 0.4953 = 0.8 ± 1.002. The 95% CI is approximately (−0.202, 1.802). Point 4 — Interpret in context (1 pt): We are 95% confident that the true difference in mean dissolved oxygen levels (River A minus River B) is between −0.20 mg/L and 1.80 mg/L. Because the interval contains 0, we do not have convincing evidence at the 95% confidence level that the mean dissolved oxygen levels differ between the two rivers.

Question 5: CRITICAL THINKING

4 pts
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?
Show answer
Rubric (4 points): Point 1 — Explain why paired design is narrower (1 pt): In Design B (paired), each person serves as their own control, so subject-to-subject variability in baseline reaction time is eliminated from the analysis. The standard deviation of the differences (sds_d) is typically much smaller than the individual group standard deviations because the natural variation among people is removed. Since SE_paired = sds_d/√n and sds_d is generally smaller than √(s₁² + s₂²), the margin of error is reduced, yielding a narrower interval. Essentially, pairing reduces the "noise" by accounting for consistent individual differences. Point 2 — Circumstances favoring Design A (1 pt): Design A (independent groups) is preferred when: (1) there is a risk of carryover effects—if Intervention 1 could permanently alter reaction time, the washout period may be insufficient, biasing the paired comparison; (2) the intervention is irreversible or the outcome can only be measured once (e.g., a surgical procedure); (3) the logistics of having each participant complete both conditions are impractical or the study requires blinding that a crossover design would compromise. Design A also does not require the ordering/counterbalancing that Design B needs to control for practice or fatigue effects. Point 3 — Risk of pooling (1 pt): The pooled t-procedure assumes σ₁ = σ₂. If this assumption is wrong—that is, if the two population variances are substantially different—the pooled standard error will be biased: it overestimates the SE when the larger-variance group has the larger sample and underestimates it when the smaller-variance group has the larger sample. This can lead to confidence intervals with actual coverage rates that differ from the stated level (either too liberal or too conservative). Point 4 — How the Welch procedure protects (1 pt): The Welch (unpooled) procedure estimates each population variance separately using s₁²/n₁ and s₂²/n₂, so the standard error is correctly calculated regardless of whether the variances are equal. The Satterthwaite degrees of freedom adjust downward to reflect the additional uncertainty from estimating two separate variances, keeping the coverage probability close to the nominal level. When σ₁ actually does equal σ₂, the Welch procedure only slightly loses efficiency compared to the pooled version, making it the safer default choice—which is why the AP exam expects you to use the unpooled version.

SUMMARY

Lesson Summary

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