What this calculator does
This calculator performs inference for the difference between two population proportions,
p1 − p2, using the large-sample normal approximation for two
independent samples.
You can compute either a confidence interval (CI) or a hypothesis test (HT) with a z statistic.
When to use it
- Two samples are independent (different groups, no pairing).
- Each sample is “large” so the normal approximation is reasonable.
A common rule-of-thumb is that each sample has enough expected successes and failures
(the calculator shows this check after you calculate).
Inputs
x1, n1: successes and sample size for sample 1.
x2, n2: successes and sample size for sample 2.
-
For a confidence interval: choose a
confidence level (e.g., 95%).
-
For a hypothesis test:
choose
δ0 (null difference, usually 0), an alternative
(two-tailed / right-tailed / left-tailed), and α.
How to run a confidence interval
- Select Confidence interval in the Task dropdown.
- Enter
x1, n1, x2, n2.
- Choose the confidence level and click Calculate.
Interpretation: the reported interval is a plausible range for p1 − p2 at your chosen confidence level.
How to run a hypothesis test
- Select Hypothesis test in the Task dropdown.
- Enter
x1, n1, x2, n2.
- Set
δ0 (usually 0), choose the alternative, pick α, then click Calculate.
The calculator reports the p-value (and optionally critical values) and a decision at your chosen α.
Reading the visualization
The plot is a standard normal curve. After you calculate:
- CI: the center area corresponds to the confidence level; ±z* markers are shown.
- HT: the blue shading represents the p-value area; red shading shows the rejection region(s) for α.
Batch mode (optional)
Use the Batch/CSV section if you want to compute many rows at once. Paste CSV rows with
x1,n1,x2,n2 and optionally task (ci/ht) plus settings like conf, alpha, delta0, alt.