Ask Mallard
Analysis method

Cochran-Mantel-Haenszel test

4 min read

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

Before you start

What you need

Decide these first
  1. Two-by-two event counts within each stratumUse consistent exposure and outcome coding. Keep all four cells and their denominators.
  2. Prespecified baseline strataChoose factors relevant to confounding. Excessively fine strata can leave sparse cells.
  3. Pooling and test conventionssummaryMeasureState continuity correction, the pooled interval method and the homogeneity check.
It rests on these
  1. 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.
  2. 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.
  3. Counts support the large-sample test approximations.How to check: Check expected counts within strata. Many sparse strata need more specialized inference.
  4. 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.
  5. 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 method at a glance
Cochran-Mantel-Haenszel test: Separate two-by-two tables by stratum. Then CMH association test and homogeneity check. Then Common odds ratio if pooling is meaningful.Cochran-Mantel-Haenszel testSeparate two-by-two tablesby stratumCMH association test andhomogeneity checkCommon odds ratio ifpooling is meaningfulBreslow-Day checks homogeneity; a large p-value does not establish equal stratum effects.
Conceptual diagram. It shows the structure of the idea, not data from any study.
Inference and checks

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

Invented for illustration
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

Searching PubMed…

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.

No Mallard code example points to this page.
Atlas node analysis.cochran_mantel_haenszel, the id a plan cue records.

Related Learn pages

Related designs and methods

Evidence

Sources & further reading

  1. Statistical aspects of the analysis of data from retrospective studies of disease (opens in a new tab) · J Natl Cancer Inst
  2. Statistical methods in cancer research. Volume I - The analysis of case-control studies (opens in a new tab) · IARC Sci Publ
  3. Estimators of the Mantel-Haenszel variance consistent in both sparse data and large-strata limiting models (opens in a new tab) · Biometrics
Prepared with AI assistance. PubMed records checked by title, authors, year and available DOI on 2026-11-07. Record verified; confirm it supports this use. No independent professional approval is claimed. Mantel and Haenszel introduce stratified association analysis. Breslow and Day describe homogeneity assessment; their classic 1980 volume IS indexed in PubMed. Robins, Breslow and Greenland support the variance used for the pooled odds-ratio interval. PubMed supplies no DOI for these three records. Cochran’s classic 1954 paper, Some methods for strengthening the common chi-squared tests, was not found in PubMed by author and title; no PMID is assigned.
Last source review: 2026-11-07
AI-generated educational content
Mallard uses reputable methodological and reporting sources, but this material may contain errors or omit important context. Verify important methodological decisions with the cited sources and, when appropriate, a qualified research methodologist or statistician.