Course contentsShow
← Data Science
Lesson 287 of 2,1458. Confidence IntervalsFree lesson

Confidence Intervals for the Difference Between Two Proportions

Learn to build and interpret confidence intervals for the difference between two population proportions.

Confidence Intervals for the Difference Between Two Proportions

You'll learn: How to build and interpret confidence intervals that estimate how much two population proportions differ from each other.

The Core Idea

You've already learned to build confidence intervals for a single proportion (like estimating the true conversion rate of one website). Now imagine you have two groups—say, customers shown ad version A versus ad version B—and you want to know: how much do their conversion rates truly differ?

Just like with single proportions, we use sample data to estimate the difference between two population proportions. The confidence interval gives us a plausible range for that true difference.

The Formula

The confidence interval for the difference (p₁ - p₂) follows this pattern:

(p̂₁ - p̂₂) ± z × SE*

Where:

  • p̂₁ and p̂₂ are your two sample proportions
  • z* is the critical value (typically 1.96 for 95% confidence)
  • SE is the standard error for the difference, calculated as:

SE = √[(p̂₁(1-p̂₁)/n₁) + (p̂₂(1-p̂₂)/n₂)]

Notice the formula combines both sample proportions' standard errors using the square root of their sum—this accounts for variability in both groups.

Interpretation

If your 95% CI for (p₁ - p₂) is [0.02, 0.08], you'd say: "We're 95% confident the true difference in proportions falls between 2% and 8%." Since this interval doesn't contain zero, there's likely a real difference between the groups.

Key Takeaway: Confidence intervals for the difference between two proportions let you quantify how much two groups differ, with a margin of error, helping you make evidence-based comparisons like A/B test results or demographic disparities.