Z-Test for Difference Between Two Proportions
Use this calculator to test if two population proportions differ (e.g., comparing success rates between two groups).
When to Use
- Two independent groups with binary outcomes
- Large sample sizes where $n_1p_1 \geq 5$, $n_1(1-p_1) \geq 5$, etc.
- Testing if proportions differ between groups
- Examples: Testing if conversion rate A ≠ B, testing if defect rate differs between machines
How to Use
Step 1: Enter group 1 size and number of successes
Step 2: Enter group 2 size and number of successes
Step 3: Enter level of significance (α, typically 0.05)
Step 4: Select tail type (two-tailed for comparing)
Step 5: Click “Calculate”
| Z test Calculator for two proportions | ||
|---|---|---|
| Sample 1 | Sample 2 | |
| Sample size | ||
| No. of Successes | ||
| Level of Significance ($\alpha$) | ||
| Tail | Left tailed Right tailed Two tailed | |
| Results | ||
| sample proportions: | ||
| pooled estimate of proportion: | ||
| Standard Error of Diff. of prop.: | ||
| Test Statistics Z: | ||
| Z-critical value(s): | ||
| p-value: | ||
Test Formula
$$Z = \frac{(\hat{p}_1 - \hat{p}_2) - 0}{\sqrt{\hat{p}(1-\hat{p})\left(\frac{1}{n_1} + \frac{1}{n_2}\right)}}$$
Where:
- $\hat{p}_1 = k_1/n_1$, $\hat{p}_2 = k_2/n_2$ = sample proportions
- $\hat{p} = (k_1 + k_2)/(n_1 + n_2)$ = pooled proportion
Worked Example
Scenario: Testing if Website A conversion rate differs from Website B.
- Site A: 45/300 converted (15%)
- Site B: 30/250 converted (12%)
Hypotheses:
- H₀: p₁ = p₂ (conversion rates equal)
- H₁: p₁ ≠ p₂ (conversion rates differ)
Calculation:
- Pooled p̂ = 75/550 = 0.1364
- $SE = \sqrt{0.1364 × 0.8636 × (1/300 + 1/250)} = 0.0364$
- $Z = (0.15 - 0.12)/0.0364 = 0.824$
- p-value = 0.410
Decision: p-value (0.410) > α (0.05), fail to reject H₀. No significant difference in conversion rates.
Related: Two Proportion CI, Tutorial