Cochran-Mantel-Haenszel (stratified 2×2)
Coming soonCategorical
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 nowStratified 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.
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).
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
- Continuous outcomeCMH is for binary outcomes. → One-Way ANCOVA (covariate-adjusted)
- Paired same-subject dataCMH is for stratified independent observations. → Exact McNemar's Test (small-sample binary paired)
- Heterogeneous OR across strata (Breslow-Day rejects)Common-OR summary is misleading. → Binomial Logistic Regression \u2014 odds ratios + ROC AUC + classification
- Many continuous confounders to adjust forCMH stratifies on a single discrete variable. → Binomial Logistic Regression \u2014 odds ratios + ROC AUC + classification
Hypotheses
Parameter tested: common odds ratio OR_MH
Assumptions (and what to do if they fail)
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.
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 →