Specialty › Tests on summarized data

Two-proportion z-test

Two-proportion z-test from typed-in event / total counts (no raw data needed). Same null as Pearson χ² on a 2 × 2 table.

What is Two-proportion z-test?

Often you read a paper that gives '12/50 vs 8/50' but doesn't share the data. summary_two_prop computes the same z-test you'd get from chi_square on the reconstructed 2 × 2 table — but from the typed counts directly, no spreadsheet needed.

The Wald CI on the proportion difference is the standard report; for small samples it can extend below 0 or above 1, in which case a Newcombe / Wilson-style CI is more honest. The point estimate is the same either way.

When should I use Two-proportion z-test?

  • Re-analysing published 2 × 2 results without the raw data.
  • Quick power / effect-size check from cell counts.

What data does it need?

Events / total for each of two groups.

What does it report?

z statistic + p + proportion difference with Wald 95% CI.

What does it assume?

  • Independent groups.
  • n × p × (1 − p) ≥ ~5 in each group for the normal approximation to hold.

How do I interpret the result?

The two-proportion z-test is mathematically identical to χ² on a 2 × 2 table with one degree of freedom; the headline number is the same.

See also