Search the complete library

What do you want to learn or calculate?

Quick linksAll calculatorsMath subjectsPractice questionsFormula library
← Statistics formulas

Two-proportion z statistic

Test whether two independent population proportions differ.

Statistics · Inference
$$z=\frac{(\hat p_1-\hat p_2)-0}{\sqrt{\hat p(1-\hat p)(1/n_1+1/n_2)}}$$

Two-proportion z statistic is one of 2 inference formulas in the statistics section of this library, and it is used at ap · university level.

Why two-proportion z statistic works

The null hypothesis says both groups share a single success rate, so the best estimate of that rate uses every observation from both groups combined. The pooled value then builds one standard error for the difference, and the two reciprocal sample sizes add because the groups are independent.

What each symbol means

$\hat p$ is the pooled success proportion under the equal-proportions null.

Two-proportion z statistic: when it holds

Samples must be independent and expected success and failure counts sufficiently large.

When it stops applying

It assumes two independent samples with enough expected successes and failures in each group under the pooled rate. It does not apply when the same people are measured under both conditions, where the pairing carries the information and McNemar's test is the correct procedure.

Two-proportion z statistic: a worked example

Pool successes across both groups only for the null-test standard error.

The mistake to avoid

What people do: Using each group's own sample proportion inside the standard error for a hypothesis test.

Why it goes wrong: That is the formula for a confidence interval, where no common rate is assumed. In a test the null supplies extra information, and ignoring it produces the wrong standard error and the wrong p-value.

Do this instead: Pool the successes and the trials across both groups first, then use that single proportion in both places inside the square root.

Two-proportion z statistic: step by step

  1. Name the unknown, and the unit the answer has to come out in.
  2. Match the symbols to your values. $\hat p$ is the pooled success proportion under the equal-proportions null.
  3. Check the conditions before substituting. Samples must be independent and expected success and failure counts sufficiently large.
  4. Substitute, keep exact values to the last line, then test the sign, size, and unit against a rough estimate — the check that catches most statistics slips.

Where this formula fits

Subject
Statistics formulas — 21 entries in this library
Topic
Inference
Level
AP · University

Formulas are easiest to keep when they sit inside a method rather than on a list. Use the links below to see where two-proportion z statistic comes from, to check a calculation against a tool, and to practise it until you can recall it without looking.

Questions about two-proportion z statistic

Why pool for the test but not for the interval?

Because the test assumes the two rates are equal and the interval does not. Under the null there is one common rate worth estimating from all the data; when estimating a difference, each group speaks for itself.

How many successes are enough?

The usual guideline is at least ten successes and ten failures in each group. Below that, the normal shape is a poor stand-in for the discrete counts and an exact method is safer.

Is this equivalent to a chi-square test on a two-by-two table?

Yes, for a two-sided test. With 30 of 100 against 45 of 100, the statistic is about -2.191 and its square is 4.80, matching the chi-square value of 4.80 exactly.

What does the zero in the numerator represent?

It is the difference claimed by the null hypothesis, namely no difference at all. If you were testing a specific nonzero gap, you would subtract that value instead and stop pooling.

Stuck on a problem?

Work a two-proportion z statistic problem step by step

Type your own problem, or upload a photo of it. You get the method, the answer, and a check you can repeat yourself.