Confidence Interval for Difference Between Two Proportions
Use this calculator for confidence intervals comparing two population proportions (e.g., success rates between two groups).
When to Use
- Two independent groups with binary outcomes
- Large sample sizes where $n_1\hat{p}_1 \geq 5$, $n_1(1-\hat{p}_1) \geq 5$, etc.
- Comparing proportions between two populations
- Examples: Conversion rate A vs B, defect rate before vs after, approval rate male vs female
How to Use
Step 1: Enter sample 1 size and number of successes
Step 2: Enter sample 2 size and number of successes
Step 3: Select confidence level (typically 95%)
Step 4: Click “Calculate”
| Confidence interval for Difference Between proportions | ||
|---|---|---|
| Sample 1 | Sample 2 | |
| Sample size | ||
| No. of successes | ||
| Confidence Level ($1-\alpha$) | ||
| Results | ||
| Sample proportions: | ||
| Standard Error of Diff. of prop.: | ||
| Z-critical value: | ||
| Margin of Error: | ||
| Lower Confidence Limits: | ||
| Upper Confidence Limits: | ||
Formula
$$CI = (\hat{p}_1 - \hat{p}2) \pm z{\alpha/2} \times \sqrt{\frac{\hat{p}_1(1-\hat{p}_1)}{n_1} + \frac{\hat{p}_2(1-\hat{p}_2)}{n_2}}$$
Where:
- $\hat{p}_1 = k_1/n_1$, $\hat{p}_2 = k_2/n_2$ = sample proportions
- $z_{\alpha/2}$ = z-critical value (1.96 for 95%)
Requirements
- Large samples: Both $n_i\hat{p}_i \geq 5$ and $n_i(1-\hat{p}_i) \geq 5$
- Random samples
- Independent groups - no overlap
Worked Example
Scenario: Website A: 245/500 users converted. Website B: 180/500 users converted.
Solution:
- $\hat{p}_1 = 245/500 = 0.49$, $\hat{p}_2 = 180/500 = 0.36$
- $SE = \sqrt{\frac{0.49×0.51}{500} + \frac{0.36×0.64}{500}} = 0.0310$
- $E = 1.96 × 0.0310 = 0.0608$
- $CI = 0.13 ± 0.0608 = [0.069, 0.191]$ or [6.9%, 19.1%]
Interpretation: Website A’s conversion rate is 6.9% to 19.1% higher than Website B with 95% confidence.
Related: Single Proportion CI, Tutorial