Cochran-Mantel-Haenszel test
The Cochran-Mantel-Haenszel test checks association across stratified two-by-two tables; a pooled odds ratio summarizes the association when a common effect is credible.
Fit
When to use it, and when not to
Use it when
- You compare two binary variables within a few prespecified strata.
- You need a stratum-adjusted association and a common odds ratio is meaningful.
Not when
- You need many continuous covariates. Use logistic regression with a justified model. Read: Logistic regression
- Odds ratios differ meaningfully across strata. Report stratum effects and model interaction rather than one common effect. Read: Effect modification and interaction
Before you start
What you need
- Two-by-two event counts within each stratumUse consistent exposure and outcome coding. Keep all four cells and their denominators.
- Prespecified baseline strataChoose factors relevant to confounding. Excessively fine strata can leave sparse cells.
- Pooling and test conventionssummaryMeasureState continuity correction, the pooled interval method and the homogeneity check.
- People are independent within and across strata.How to check: Check whether patients repeat or share clusters. Ordinary stratified-table inference does not cover those designs.
- A common odds ratio is a useful summary.How to check: Inspect stratum estimates. Breslow-Day tests homogeneity but has limited power and needs adequate cell counts.
- Counts support the large-sample test approximations.How to check: Check expected counts within strata. Many sparse strata need more specialized inference.
- A causal claim needs adequate control of baseline confounders.How to check: Choose factors using subject knowledge. Adjustment alone cannot remove bias from unrecorded causes.
- The analysis matches the stated missing-data assumption.How to check: Missing at random means gaps depend on recorded factors. Account for those factors and assess plausible departures.
Plain language
How it works
Within each stratum, compare observed exposed events with the expectation under no association. Combine these differences using their null variances. The uncorrected Cochran-Mantel-Haenszel statistic has an approximate chi-square distribution with one degree of freedom.
The Mantel-Haenszel odds ratio divides summed event/non-event cross-products, each weighted by the inverse stratum total. Its log-Wald interval uses the Robins-Breslow-Greenland variance. Breslow-Day checks whether odds ratios vary across strata. It is a pooling diagnostic, not a second effect estimator. Report stratum estimates when variation matters. Adequate counts and a sensible common-effect assumption are still needed.
Worked example
A worked example
- Setting
- A complete cohort is split by baseline severity, with independent people in each stratum.
- Question
- Is exposure associated with the event after stratifying by severity?
- Approach
- Low severity: exposed 12/100, unexposed 20/100. High severity: exposed 30/100, unexposed 45/100. Use uncorrected CMH and unadjusted Breslow-Day tests.
- Result
- The stratum odds ratios are 0.545 and 0.524. The pooled odds ratio is 0.532, with 95% log-Wald interval 0.334 to 0.847.
- What it means
- The CMH statistic is 7.137 on 1 degree of freedom, p = 0.007553. Breslow-Day is 0.006687 on 1 degree of freedom, p = 0.934828. A large homogeneity p-value does not prove equal effects.
In practice
Recent studies PubMed search · not vetted
Watch out
Common mistakes
The one to remember
A common odds ratio can hide differences between strata. Inspect stratum estimates and assess homogeneity with Breslow-Day; a large p-value does not prove equal effects. The pooled odds ratio is not a risk ratio, and stratification controls only recorded factors.
- Adding all strata into one table before testing.Instead: Keep strata separate for the test and weighted odds-ratio estimate; a crude table can mask confounding.
- Calling the pooled odds ratio a risk ratio.Instead: Name the measure as odds. With common outcomes, odds and risk can differ substantially.
- Treating a change after stratification as proof of confounding.Instead: Odds ratios are non-collapsible. Assess the causal structure, rather than diagnosing confounding from coefficient change alone.
Inside Mallard
How Mallard uses this
Mallard offers this lesson in Learn search and the Atlas. Plans do not link to it automatically.
analysis.cochran_mantel_haenszel, the id a plan cue records.Related Learn pages
Related designs and methods
Evidence
Sources & further reading
- Statistical aspects of the analysis of data from retrospective studies of disease (opens in a new tab) · J Natl Cancer Inst
- Statistical methods in cancer research. Volume I - The analysis of case-control studies (opens in a new tab) · IARC Sci Publ
- Estimators of the Mantel-Haenszel variance consistent in both sparse data and large-strata limiting models (opens in a new tab) · Biometrics