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.

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, p1p2, 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.

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.

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.

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.

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̂₁ − 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 − 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̂₁ − 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.

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.

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.

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
Step 1 — Identify the Parameter and StatisticsLet 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
Step 2 — Check ConditionsRandom: 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
Step 3 — Calculate the Standard ErrorSE = √[ 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
Step 4 — Find the Critical Value and Margin of ErrorFor 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
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
Step 6 — Interpret in ContextWe 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.

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.

Comparison of key strengths and limitations of the two-proportion z-interval.
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.
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.

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.

Key differences between the two-proportion confidence interval and hypothesis test.
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

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.

Practice Problems

1
A 95% confidence interval for p₁ − p₂ is (−0.03, 0.11). Which of the following is the best interpretation?
2
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̂₂?
3
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?
PROBLEM 4APPLIED
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.
PROBLEM 5CRITICAL THINKING
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.

Lesson 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