Two-Proportions Z-Test
VerifiedCategorical
Run this test straight away on a free built-in teaching dataset — no data of your own needed — or bring your own. Either opens the guided workspace: variable setup, assumption diagnostics, results with effect sizes and confidence intervals, figures, and APA-ready reporting.
Loading teaching datasets…
Or use your own dataset
Loading your datasets…
Compares the proportion of successes between two independent groups using the asymptotic z-test on the pooled-variance estimator z = (p̂₁ − p̂₂) / SE_pooled with normal-approximation p.
Reports the proportion difference + 95% CI (Wald or Newcombe score), risk ratio, odds ratio, and number-needed-to-treat. The engine auto-companions Fisher's exact when the normal approximation is questionable (any cell np or n(1−p) < 5). The default 2-group binary-outcome test for moderate-large samples; compare to the McNemar test for paired designs.
Worked example
Do two landing pages differ in sign-up rate?
Sign-ups from Page A (128 of 500) and Page B (164 of 500) were compared with a two-proportion z-test.
Page B converted better (32.8% vs 25.6%), a 7.2-point lift, z = 2.50, p = .012.
A two-proportion z-test showed Page B's sign-up rate (32.8%) significantly exceeded Page A's (25.6%), z = 2.50, p = .012.
Try it yourself: Load this ready-made sample and follow the run above.
When to use it
- Two independent groups with a binary outcome60 patients randomised to a new drug vs placebo; outcome is whether 30-day re-admission occurred.
- A/B test of conversion / click-through ratesAn e-commerce site randomly serves checkout-page variant A or B to 5,000 users each.
When NOT to — use instead
- Same subjects measured twice (paired)Paired binary → use McNemar's test on discordant pairs. → McNemar's Test (paired 2\u00d72)
- Sparse cells (any np or n(1−p) < 5)Normal approximation breaks down. → Fisher's Exact Test
- Three or more groupsTwo-proportions handles exactly 2 groups. → Chi-Square Test of Independence
- Continuous outcomeTwo-proportions is for binary outcomes only. → Independent Samples t-test
Hypotheses
Parameter tested: population proportion difference p₁ − p₂
Assumptions (and what to do if they fail)
Check: All four counts ≥ 5 → normal approximation valid.
If violated: Small per-cell counts make the z-test's Type I error rate unreliable; sampling distribution is not well-approximated by the Normal.
Check: Verify 'success' has a single operational definition.
If violated: Inconsistent classification biases proportion estimates and invalidates the test.
Check: Document the sampling frame and any selection filters.
If violated: Non-random sampling undermines inference to a defined population.
Ready to run a Two-Proportions Z-Test on your own data?
Guided setup, automatic assumption checks, effect sizes, figures and an APA write-up.
Run this test →