AP Statistics • Inference for Categorical Data: Proportions

Confidence Intervals for the Difference of Two Proportions

Quantify uncertainty when comparing success rates across two independent groups.

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

SECTION 1

Historical Context & Motivation

Statistics has always been driven by the need to make reliable comparisons. When a pharmaceutical company tests a new drug against a placebo, when a political analyst compares voter preferences between two demographic groups, or when an educator examines pass rates across two curricula, the fundamental question is the same: is there a real difference between these two groups, or could the observed gap be due to chance alone? The confidence interval for the difference of two proportions provides a principled framework for answering this question, offering not just a point estimate of the difference but a plausible range of values that accounts for sampling variability.

The intellectual foundations of this method trace back centuries, from early probability theory through the formalization of sampling distributions and the development of modern inferential statistics. Understanding this history reveals why the method works the way it does and why certain conditions must hold for the interval to be valid.

1713 • Bernoulli's Ars Conjectandi

Jacob Bernoulli published his foundational work on the law of large numbers, establishing that sample proportions converge to the true population proportion as the sample size grows — the theoretical bedrock for all proportion-based inference.

1810 • Laplace & the Central Limit Theorem

Pierre-Simon Laplace demonstrated that sums (and therefore means and proportions) of independent random variables approach a normal distribution. This result justifies using the normal model to construct confidence intervals for proportions.

1934 • Neyman's Confidence Interval Framework

Jerzy Neyman formalized the modern theory of confidence intervals, defining the concept of a coverage probability and providing a rigorous frequentist interpretation that underpins every interval we construct today.

1998 • Agresti–Caffo Improvement

Alan Agresti and Brian Caffo proposed an adjusted Wald interval for the difference of two proportions, adding pseudocounts to improve coverage when sample sizes are small — a refinement that highlights ongoing research into interval estimation.

The central question this lesson addresses is: given two independent random samples from two populations, how do we construct an interval estimate for the true difference in population proportions, p1 − p2, and how do we interpret that interval correctly? Mastering this procedure is essential for the AP Statistics exam, where it appears in both multiple-choice and free-response contexts.

SECTION 2

Core Principles & Definitions

Before diving into formulas, it is essential to establish the conceptual pillars that support the two-proportion confidence interval. Each principle below connects sampling theory to the practical mechanics of the procedure. These ideas will recur throughout the lesson, so internalizing them now will make the mathematical framework far more intuitive.

1

Parameter vs. Statistic

The parameter of interest is p₁ − p₂, the true difference in population proportions. The statistic p̂₁ − p̂₂ is computed from sample data and serves as our point estimate.
2

Sampling Distribution

If both samples are large enough, the sampling distribution of p̂₁ − p̂₂ is approximately normal, centered at p₁ − p₂, with a standard deviation called the standard error.
3

Independence Requirement

The two samples must be independent of each other, and observations within each sample must be independent. The 10% condition (n < 0.10N) ensures sampling without replacement doesn't violate this.
4

Normal (Large Counts) Condition

For each sample, the number of successes and failures must both be at least 10: n₁p̂₁ ≥ 10, n₁(1 − p̂₁) ≥ 10, and likewise for sample 2. This justifies the normal approximation.
5

Confidence Level & Margin of Error

The confidence level C (typically 0.95) determines the critical value z*. The margin of error equals z* × SE, producing an interval that captures the true difference in C% of all possible samples.
✦

KEY TAKEAWAY

Think of a confidence interval as a net you cast into a stream to catch a fish (the true parameter). A wider net (higher confidence level) catches the fish more often but tells you less about where it is. A narrower net (lower confidence level or larger sample) pinpoints the fish's location but risks missing it entirely. The two-proportion interval works the same way: the margin of error determines the width of your net, and the confidence level determines how often your procedure succeeds across repeated sampling.

SECTION 3

Visualizing the Sampling Distribution

The diagram below illustrates the core idea behind the two-proportion confidence interval. The sampling distribution of p̂₁ − p̂₂ is approximately normal when the large counts condition is satisfied. The interval is centered at the observed difference and extends one margin of error in each direction. The shaded central region represents the confidence level — the proportion of intervals from repeated samples that would capture the true parameter.

Sampling Distribution of p̂₁ − p̂₂Densityp̂₁ − p̂₂(p̂₁ − p̂₂)95% Confidence Interval(p̂₁−p̂₂) − z*·SE(p̂₁−p̂₂) + z*·SE2.5% tail2.5% tail
The bell-shaped curve (violet) represents the approximately normal sampling distribution of p̂₁ − p̂₂. The shaded cyan region captures 95% of the area. The dashed yellow line marks the center of the interval (the point estimate), and the cyan bracket spans from the lower bound to the upper bound — one margin of error in each direction.

Notice that the interval is symmetric about the point estimate p̂₁ − p̂₂. The width of the interval depends on two factors: the critical value z* (which increases with confidence level) and the standard error (which decreases as sample sizes grow). Increasing both n₁ and n₂ shrinks the standard error, producing a narrower — and therefore more informative — interval.

SECTION 4

Mathematical Framework

The formula for a two-proportion z-interval follows directly from the general structure of all confidence intervals: point estimate ± (critical value)(standard error). Here we develop each component, explain where the standard error formula comes from, and list the conditions that must be verified before constructing the interval.

POINT ESTIMATE

p^1−p^2p̂₁ − p̂₂

where p̂₁ = x₁ / n₁ is the sample proportion of successes in group 1, and p̂₂ = x₂ / n₂ is the sample proportion of successes in group 2.

STANDARD ERROR

SE=√[p^1(1−p^1)/n1+p^2(1−p^2)/n2]SE = √[ p̂₁(1 − p̂₁) / n₁ + p̂₂(1 − p̂₂) / n₂ ]

Because the two samples are independent, the variances of the individual sampling distributions add. We estimate each population proportion with its sample proportion, yielding p̂₁(1 − p̂₁)/n₁ and p̂₂(1 − p̂₂)/n₂. Their sum is the estimated variance of the difference; the square root gives the standard error. Note: unlike hypothesis testing for two proportions, we do not pool the proportions when constructing a confidence interval.

CONFIDENCE INTERVAL FORMULA

(p^1−p^2)±z∗⋅√[p^1(1−p^1)/n1+p^2(1−p^2)/n2](p̂₁ − p̂₂) ± z* · √[ p̂₁(1 − p̂₁) / n₁ + p̂₂(1 − p̂₂) / n₂ ]

z* is the critical value from the standard normal distribution corresponding to the desired confidence level C. Common values: z* = 1.645 for 90%, z* = 1.960 for 95%, z* = 2.576 for 99%.

Conditions for Inference

  • ✓ Random: Both samples must come from random sampling or randomized experiments. This ensures the statistics are unbiased estimators of the parameters.
  • ✓ Independent (10% condition): The two samples are independent of each other. When sampling without replacement, each sample must be less than 10% of its population: n₁ < 0.10 N₁ and n₂ < 0.10 N₂.
  • ✓ Normal (Large Counts): The number of observed successes and failures in each sample must be at least 10: n₁p̂₁ ≥ 10, n₁(1 − p̂₁) ≥ 10, n₂p̂₂ ≥ 10, and n₂(1 − p̂₂) ≥ 10.
💡

AP Exam Tip

On the AP exam, you must explicitly verify all three conditions — Random, Independent (10%), and Normal (Large Counts) — to earn full credit on free-response questions. Use the observed counts (not hypothesized proportions) when checking large counts for a confidence interval.

SECTION 5

Interpreting the Interval

Constructing the interval is only half the task; interpreting it correctly is equally important — and a frequent source of lost points on the AP exam. The interpretation must reference the confidence level, the parameter (not the statistic), and the context of the problem. Furthermore, whether the interval contains zero has direct implications for whether there is convincing evidence of a difference between the two population proportions.

Does the Interval Contain Zero?0p₁ − p₂Scenario A: Interval contains 0−0.080.04→ 0 is plausible No convincing evidence of a differenceScenario B: Entirely positive0.030.15→ p₁ > p₂Scenario C: Entirely negative−0.12−0.02→ p₁ < p₂
Three possible outcomes for a two-proportion confidence interval. Scenario A: the interval straddles zero, so zero is a plausible value for p₁ − p₂ (no convincing evidence of a difference). Scenario B: the entire interval is positive, suggesting p₁ > p₂. Scenario C: the entire interval is negative, suggesting p₁ < p₂. The yellow dot in each interval marks the point estimate.

Template Interpretation (AP Exam Format)

A well-written interpretation on the AP exam follows this template: "We are C% confident that the true difference in the proportion of [context for group 1] and the proportion of [context for group 2] who [response] is between (lower bound) and (upper bound)." Notice the three essential components: the confidence level, the parameter in context (referencing both populations and the variable), and the interval bounds. Omitting any of these components risks a deduction.

⚠

Common Mistake

Do NOT say "there is a 95% probability that the true difference lies in this interval." Once the interval is computed, the true difference either is or is not in the interval — probability no longer applies. The 95% refers to the long-run success rate of the method, not to any single interval.

SECTION 6

Worked Example

A researcher wants to compare the proportion of adults who support a proposed policy in City A versus City B. A random sample of 400 adults in City A finds that 220 support the policy. An independent random sample of 500 adults in City B finds that 245 support the policy. Construct a 95% confidence interval for the difference in the proportion of adults who support the policy (City A − City B). There are over 100,000 adults in each city.

Two-Proportion Z-Interval: Policy Support

  1. 1

    Step 1 — Identify the Parameter and Statistics

    Let p₁ = the true proportion of all adults in City A who support the policy, and p₂ = the true proportion of all adults in City B who support the policy. We want to estimate p₁ − p₂. The sample proportions are p̂₁ = 220/400 = 0.55 and p̂₂ = 245/500 = 0.49.
    p̂₁ − p̂₂ = 0.55 − 0.49 = 0.06
  2. 2

    Step 2 — Check Conditions

    Random: Both samples are stated to be random samples. ✓ Independent (10% condition): The samples are from different cities, so they are independent. Also, 400 < 10% of 100,000+ and 500 < 10% of 100,000+. ✓ Normal (Large Counts): City A: 220 successes ≥ 10 and 180 failures ≥ 10. City B: 245 successes ≥ 10 and 255 failures ≥ 10. ✓ All conditions are met.
  3. 3

    Step 3 — Calculate the Standard Error

    SE = √[ p̂₁(1 − p̂₁)/n₁ + p̂₂(1 − p̂₂)/n₂ ] = √[ (0.55)(0.45)/400 + (0.49)(0.51)/500 ] = √[ 0.2475/400 + 0.2499/500 ] = √[ 0.00061875 + 0.0004998 ] = √0.00111855
    SE ≈ 0.03344
  4. 4

    Step 4 — Find the Critical Value and Margin of Error

    For a 95% confidence level, z* = 1.960. The margin of error is ME = z* × SE = 1.960 × 0.03344 ≈ 0.06554.
    ME ≈ 0.0655
  5. 5

    Step 5 — Construct the Interval

    (p̂₁ − p̂₂) ± ME = 0.06 ± 0.0655 = (0.06 − 0.0655, 0.06 + 0.0655) = (−0.0055, 0.1255).
    95% CI: (−0.006, 0.126)
  6. 6

    Step 6 — Interpret in Context

    We are 95% confident that the true difference in the proportion of adults who support the policy in City A and the proportion who support it in City B is between −0.006 and 0.126. Because the interval contains 0, there is not convincing evidence at the 95% confidence level that the proportions differ between the two cities.

SECTION 7

Strengths, Limitations & Common Errors

Like any statistical procedure, the two-proportion z-interval has both strengths that make it widely useful and limitations that must be understood to apply it responsibly. Recognizing these helps you make informed decisions about when the procedure is appropriate and how to communicate results honestly.

StrengthsLimitations
Provides a range of plausible values rather than a single point estimate, quantifying uncertainty.Relies on the normal approximation, which may be poor when sample sizes are small or proportions are near 0 or 1.
Straightforward to compute by hand or with a calculator; widely supported by technology (TI-83/84, software).Assumes independent random samples; cannot be applied to matched-pairs or dependent data.
Can be used to assess whether a difference exists (check if 0 is in the interval) without a formal hypothesis test.Width depends on both sample sizes; very large samples can produce misleadingly narrow intervals that highlight trivial differences.
Interpretable by a broad audience — easier to communicate than p-values or test statistics.Does not establish causation; only a randomized experiment (not an observational study) permits causal conclusions.

Comparison of key strengths and limitations of the two-proportion z-interval.

✦

KEY TAKEAWAY

A confidence interval is like a measuring tape for uncertainty. Just as an engineer reports a bridge measurement as 12.0 ± 0.2 meters (acknowledging instrument precision), a statistician reports p̂₁ − p̂₂ ± ME (acknowledging sampling variability). The interval honestly communicates what the data can and cannot tell us about the true difference.

SECTION 8

Connection to Hypothesis Testing & Advanced Methods

The two-proportion z-interval is closely related to the two-proportion z-test, but there is a critical mechanical difference in how the standard error is computed. Understanding this distinction deepens your conceptual grasp and prevents a common AP exam error. Beyond the AP curriculum, the Wald interval has been refined by methods that achieve better coverage in small-sample and extreme-proportion scenarios.

FeatureConfidence IntervalHypothesis Test
GoalEstimate a plausible range for p₁ − p₂Test whether p₁ − p₂ = 0 (or another hypothesized value)
Standard ErrorUses individual sample proportions: p̂₁ and p̂₂ separatelyUses the pooled proportion p̂c = (x₁ + x₂)/(n₁ + n₂)
Why?No assumed value for p₁ − p₂; estimate each separatelyUnder H₀: p₁ = p₂, so pooling gives the best single estimate
OutputAn interval: (lower bound, upper bound)A z-statistic and a p-value
RelationshipIf 0 is not in the C% CI, then the two-sided test at α = 1 − C rejects H₀If the test rejects H₀ at α, then 0 is not in the (1 − α) CI

Key differences between the two-proportion confidence interval and hypothesis test.

Looking beyond the AP curriculum, researchers frequently use the Agresti–Caffo interval, which adds one success and one failure to each sample before computing the Wald interval. This simple adjustment dramatically improves coverage when sample sizes are modest. In more advanced settings, logistic regression provides a framework for comparing proportions while controlling for confounding variables — a natural extension of the ideas you are learning here. The foundational logic, however, remains the same: estimate the difference, quantify the uncertainty, and interpret in context.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

A 95% confidence interval for p₁ − p₂ is (−0.03, 0.11). Which of the following is the best interpretation?
  • A. There is a 95% probability that the true difference p₁ − p₂ falls between −0.03 and 0.11.
  • B. We are 95% confident that the true difference in population proportions is between −0.03 and 0.11.
  • C. In 95% of all samples, p̂₁ − p̂₂ will be between −0.03 and 0.11.
  • D. 95% of the individuals in the two samples have a difference in proportions between −0.03 and 0.11.
  • E. We are 95% confident that the sample difference p̂₁ − p̂₂ is between −0.03 and 0.11.
Show answer (B)
B is correct. A proper interpretation references the confidence level, the parameter (true difference in population proportions), and the interval bounds. A is wrong because it assigns a probability to the parameter; the interval is fixed once computed, and the parameter is a constant. C is wrong because it describes the behavior of the statistic (not the parameter) and the specific interval does not describe all future statistics. D is wrong because a confidence interval is about population parameters, not individual-level differences. E is wrong because the interval estimates the population parameter, not the sample statistic (we already know the exact sample statistic).

Question 2: BASIC CALCULATION

In a study, 60 out of 200 subjects in group 1 tested positive, and 45 out of 250 subjects in group 2 tested positive. What is the standard error of p̂₁ − p̂₂?
  • A. 0.0016
  • B. 0.0371
  • C. 0.0405
  • D. 0.0520
  • E. 0.0013
Show answer (C)
First compute p̂₁ = 60/200 = 0.30 and p̂₂ = 45/250 = 0.18. The standard error of p̂₁ − p̂₂ (unpooled) is SE = √[p̂₁(1 − p̂₁)/n₁ + p̂₂(1 − p̂₂)/n₂]. Calculate each term: p̂₁(1 − p̂₁)/n₁ = (0.30)(0.70)/200 = 0.21/200 = 0.00105. p̂₂(1 − p̂₂)/n₂ = (0.18)(0.82)/250 = 0.1476/250 = 0.00059040. Sum = 0.00105 + 0.00059040 = 0.00164040. SE = √0.00164040 ≈ 0.0405. The correct answer is C (0.0405). A is wrong — 0.0016 is approximately the variance (the sum before taking the square root), not the standard error. B is wrong — 0.0371 could result from incorrectly using a pooled proportion, which is not appropriate for a confidence interval. D is wrong — 0.0520 results from a miscalculation using an incorrect formula. E is wrong — 0.0013 is close to the variance of the difference, not the standard error.

Question 3: INTERMEDIATE

A researcher constructs a 90% confidence interval for p₁ − p₂ and obtains (0.02, 0.14). If the researcher instead constructs a 99% confidence interval using the same data, which of the following must be true?
  • A. The 99% interval will be narrower and will definitely still exclude 0.
  • B. The 99% interval will be wider and will definitely still exclude 0.
  • C. The 99% interval will be wider and may or may not contain 0.
  • D. The 99% interval will have the same width but a different center.
  • E. The 99% interval will be wider and will definitely contain 0.
Show answer (C)
C is correct. Increasing the confidence level from 90% to 99% increases z* (from 1.645 to 2.576), which increases the margin of error and produces a wider interval. The center (point estimate) stays the same. Whether 0 falls in the wider interval depends on how much the margin of error increases relative to the lower bound (0.02). The point estimate is 0.08 and the 90% ME is 0.06, so the 99% ME would be 0.06 × (2.576/1.645) ≈ 0.094, giving an interval of roughly (−0.014, 0.174), which would include 0. So in this specific case, the interval would contain 0, but the question asks what 'must' be true in general — and in principle a wider interval 'may or may not' contain 0. A is wrong because higher confidence produces wider (not narrower) intervals. B is wrong because the wider interval could extend past 0. D is wrong because the width changes. E is wrong because it is not guaranteed; it depends on the specific data.

Question 4: APPLIED

4 pts
A health researcher randomly surveys 350 adults in Region X and finds that 112 exercise regularly. An independent random sample of 400 adults in Region Y finds that 156 exercise regularly. There are well over 10,000 adults in each region. (a) Construct a 95% confidence interval for the difference in the proportion of adults who exercise regularly (Region X − Region Y). (b) Based on your interval, is there convincing evidence that the proportion who exercise regularly differs between the two regions? Explain.
Show answer
Rubric (4 points): Point 1 — State parameter and check conditions: Let p₁ = true proportion in Region X who exercise regularly; p₂ = true proportion in Region Y who exercise regularly. Random: both are stated to be random samples. ✓ Independent (10%): 350 < 10% of 10,000+ and 400 < 10% of 10,000+; samples are from different regions. ✓ Normal (Large Counts): Region X: 112 ≥ 10 and 238 ≥ 10; Region Y: 156 ≥ 10 and 244 ≥ 10. ✓ Point 2 — Compute the interval correctly: p̂₁ = 112/350 = 0.32, p̂₂ = 156/400 = 0.39. Point estimate: 0.32 − 0.39 = −0.07. SE = √[(0.32)(0.68)/350 + (0.39)(0.61)/400] = √[0.000622 + 0.000595] = √0.001217 ≈ 0.03489. ME = 1.960 × 0.03489 ≈ 0.0684. Interval: −0.07 ± 0.0684 = (−0.138, −0.002). Point 3 — Interpret the interval in context: We are 95% confident that the true difference in the proportion of adults who exercise regularly in Region X and the proportion in Region Y is between −0.138 and −0.002. Point 4 — Draw a conclusion about evidence: Because the entire interval is below 0 (it does not contain 0), there is convincing evidence at the 95% confidence level that the proportion of adults who exercise regularly in Region X is lower than the proportion in Region Y.

Question 5: CRITICAL THINKING

4 pts
A student computes a 95% confidence interval for p₁ − p₂ and obtains (−0.05, 0.01). The student concludes: "Since the interval contains 0, we have proven that there is no difference between the two population proportions." (a) Identify the flaw in the student's reasoning. (b) Explain what the interval actually tells us about p₁ − p₂. (c) Describe two ways the researcher could obtain a more informative interval (narrower interval) in a future study, and explain the trade-off associated with each approach.
Show answer
Rubric (4 points): Point 1 — Identify the flaw (part a): A confidence interval that contains 0 does NOT prove that p₁ = p₂. Failing to find evidence of a difference is not the same as proving there is no difference. The interval includes 0 as a plausible value, but it also includes nonzero values (from −0.05 to 0.01), meaning small differences are also plausible. Absence of evidence is not evidence of absence. Point 2 — Correct interpretation (part b): The interval tells us that we are 95% confident that the true value of p₁ − p₂ lies between −0.05 and 0.01. This means the data are consistent with p₁ being up to 0.05 lower than p₂ or up to 0.01 higher. Because 0 is within this range, the data do not provide convincing evidence that the two proportions differ, but neither do they rule out a meaningful difference. Point 3 — First approach to a narrower interval (part c): Increase sample sizes. Larger n₁ and n₂ decrease the standard error (since SE is proportional to 1/√n), producing a narrower interval. The trade-off is increased cost, time, and logistical complexity. Point 4 — Second approach and trade-off (part c): Lower the confidence level (e.g., from 95% to 90%). A smaller z* reduces the margin of error. The trade-off is decreased confidence — the procedure will fail to capture the true parameter more frequently across repeated samples.

SUMMARY

Lesson Summary

Summary

A confidence interval for the difference of two proportions estimates the parameter p₁ − p₂ using the formula (p̂₁ − p̂₂) ± z* × SE, where the standard error is √[p̂₁(1 − p̂₁)/n₁ + p̂₂(1 − p̂₂)/n₂]. Crucially, the SE uses unpooled sample proportions — unlike the two-proportion z-test, which pools under the null hypothesis.

Before constructing the interval, verify the Random, Independent (10%), and Normal (Large Counts ≥ 10) conditions. When interpreting, state the confidence level, reference the parameter in context, and provide the interval bounds. If the interval does not contain 0, there is convincing evidence of a difference; if it does contain 0, the data are consistent with no difference — but that does not prove the proportions are equal.

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