Cochran-Mantel-Haenszel (stratified 2×2)

Coming soon

Categorical

This test is implemented and is currently going through StatMinds’ production verification: every statistic is independently checked against a trusted reference (scipy / R), locked with regression tests, and the screen is exercised across assumption-met/violated and significant/non-significant scenarios before it opens up.

See what’s live now

Stratified 2 × 2 × k analysis.

Tests conditional independence of a binary exposure and binary outcome given a stratum variable (typically a confounder or study site), returning a confounder-adjusted common odds ratio (OR_MH) with Robins-Breslow-Greenland 95% CI. Combines per-stratum 2×2 evidence into a single inferential statement, with Breslow-Day testing whether the per-stratum ORs are homogeneous (a critical pre-condition for the common-OR interpretation). The standard tool for multi-centre RCTs, matched / individually-stratified observational studies, and any binary-binary analysis where a key confounder needs adjustment without the machinery of a full logistic model.

Worked example

Does treatment affect recovery after adjusting for hospital site?

Treatment × recovery 2×2 tables were pooled across five hospital sites; the Cochran-Mantel-Haenszel test gives a site-adjusted association.

Result

Adjusting for site, treatment improved recovery (common OR = 2.39, CMH χ²(1) = 12.4, p < .001); Breslow-Day found the OR homogeneous across sites (p = .70).

How you'd report it (APA)

A Cochran-Mantel-Haenszel test showed treatment significantly improved recovery after adjusting for site, common OR = 2.39, χ²(1) = 12.4, p < .001.

Try it yourself: Load this ready-made sample and follow the run above.

When to use it

  • Stratified 2 × 2 design (RCT or observational)
    A multi-centre RCT evaluates drug vs placebo across 5 clinics.
  • Matched case-control study (1:1 or 1:k matching)
    100 lung-cancer cases each matched 1:2 with controls on age (5y bands), sex, and smoking status.

When NOT to — use instead

Hypotheses

H₀: exposure and outcome are CONDITIONALLY INDEPENDENT given the stratum — the common odds ratio OR_MH = 1.
Hₐ: OR_MH ≠ 1 (conditional association between exposure and outcome after adjusting for the stratum).

Parameter tested: common odds ratio OR_MH

Assumptions (and what to do if they fail)

Per-stratum counts are adequate — each 2 × 2 stratum should have ≥ 10 observations and no zero cells ideally.medium

Check: Report min per-stratum n and # of strata with zero cells.

If violated: Sparse strata make the χ² approximation unreliable, though the MH OR remains unbiased.

Breslow-Day test does not reject homogeneity of ORs across strata (p_BD ≥ 0.05).medium

Check: Report Breslow-Day p.

If violated: Heterogeneous ORs across strata mean the MH common OR does not summarise the true association well.

Ready to run a Cochran-Mantel-Haenszel (stratified 2×2) on your own data?

Guided setup, automatic assumption checks, effect sizes, figures and an APA write-up.

Run this test →