Written and maintained by CASRAI Editorial Board
Last updated
The Mantel-Haenszel method combines the odds ratios from several 2×2 tables — one per stratum of a confounding variable — into a single pooled estimate, weighted so that strata with more information contribute more. It answers a specific question: once you account for a confounder by stratifying on it, what is the common association between exposure and outcome across those strata, and is that pooled estimate meaningfully different from the crude, unstratified association you’d get by ignoring the confounder entirely? Developed by Nathan Mantel and William Haenszel for retrospective (case-control) data, it remains the standard hand-computable method for confounder adjustment on categorical data, and the direct ancestor of the log-rank test used in survival analysis.
What problem the Mantel-Haenszel method solves
A crude 2×2 table — exposure by outcome, collapsed across the whole sample — can be badly misleading whenever a third variable is associated with both the exposure and the outcome. If that confounder isn’t evenly distributed between exposed and unexposed groups, the crude odds ratio blends the real exposure–outcome association with a spurious component created by the confounder’s imbalance. Stratifying breaks the sample into subgroups within which the confounder is constant (or nearly so), computes the odds ratio separately in each stratum, then recombines those stratum-specific estimates into one number. The Mantel-Haenszel estimator is the standard way to do that recombination: rather than simply averaging the stratum ORs, it weights each stratum by how much statistical information it carries, and it works even when individual strata have small or sparse cell counts — a setting where maximum-likelihood methods like ordinary logistic regression become unstable.
The Mantel-Haenszel formula
For stratum i, with a 2×2 table of exposed/outcome+ = ai, exposed/outcome− = bi, unexposed/outcome+ = ci, unexposed/outcome− = di, and stratum total ni = ai+bi+ci+di, the pooled Mantel-Haenszel odds ratio is:
ORMH = Σ(aidi / ni) ÷ Σ(bici / ni)
Each stratum’s aidi/ni and bici/ni terms are summed separately across all strata first, and only then divided — this is not an average of the individual stratum odds ratios. Strata with larger ni and more balanced cell counts contribute proportionally more weight, which is exactly why the estimator stays well-behaved with several thin strata where a per-stratum logistic model would struggle. The same weighting logic extends to relative risk (Mantel-Haenszel risk ratio) and to incidence rate ratios from person-time data; the odds-ratio form is the one most associated with the original 1959 case-control paper.
Worked example: crude OR vs. pooled MH OR
Illustrative example — a fixed-seed simulated dataset, not drawn from a real study. Cell counts were generated from a documented data-generating process (a true common odds ratio of 2.0 applied within three risk strata, sampled with a seeded pseudorandom generator) so that the number the method is supposed to recover is known in advance. Every figure below is independently computed and reproducible from that script, not chosen to look plausible.
Three risk strata (low, medium, high baseline risk) were constructed so that patients at higher baseline risk were also more likely to receive the exposure — risk group is the confounder. Within each stratum, the true odds ratio between exposure and outcome is 2.0 by construction:
| Stratum | Exposed, outcome+ (a) | Exposed, outcome− (b) | Unexposed, outcome+ (c) | Unexposed, outcome− (d) | Stratum n | Stratum OR |
|---|---|---|---|---|---|---|
| Low risk | 16 | 204 | 20 | 500 | 740 | 1.96 |
| Medium risk | 88 | 292 | 45 | 335 | 760 | 2.24 |
| High risk | 222 | 298 | 64 | 156 | 740 | 1.82 |
Each stratum’s own odds ratio already sits close to the true value of 2.0 — 1.96, 2.24, and 1.82 — which is exactly what “the confounder is controlled once you condition on it” looks like in the data. Now collapse the three strata into one crude table by simply summing the columns, ignoring risk group entirely:
| Table | Outcome+ (exposed) | Outcome− (exposed) | Outcome+ (unexposed) | Outcome− (unexposed) | Odds ratio |
|---|---|---|---|---|---|
| Crude (unstratified) | 326 | 794 | 129 | 991 | 3.15 |
The crude odds ratio is 3.15 — roughly 58% higher than the true 2.0, because higher-risk patients were both more likely to be exposed and more likely to have the outcome regardless of exposure, and the crude table has no way to separate those two effects. Applying the Mantel-Haenszel formula to the three stratum tables instead:
ORMH = [(16×500/740) + (88×335/760) + (222×156/740)] ÷ [(204×20/740) + (292×45/760) + (298×64/740)] = 1.99, with a 95% confidence interval (Robins-Breslow-Greenland variance) of 1.56 to 2.52 — recovering the true value the crude estimate missed, and doing so with an interval that excludes the crude 3.15 entirely.
The variance and confidence interval for ORMH
The Mantel-Haenszel point estimate needs its own variance formula — it isn’t the variance of any single stratum’s odds ratio, and naively pooling stratum-level standard errors understates the true uncertainty. The standard approach is the Robins-Breslow-Greenland (1986) variance estimator for ln(ORMH), built from three sums across strata (using Pi = (ai+di)/ni, Qi = (bi+ci)/ni, Ri = aidi/ni, Si = bici/ni): it combines ΣPiRi, Σ(PiSi+QiRi), and ΣQiSi relative to the summed R and S terms used in the point estimate itself. In the worked example above it gives SE(ln ORMH) ≈ 0.122, which is what produces the 1.56–2.52 interval. Statistical software (R’s mantelhaen.test(), Stata’s mhodds/epitab, SAS’s PROC FREQ with CMH) computes this automatically — the closed-form matters mainly for understanding why the interval is narrower than you’d get by treating the pooled estimate as if it came from one large stratum.
Checking whether pooling is legitimate: the homogeneity assumption
A single pooled odds ratio is only a meaningful summary if the true odds ratio is reasonably similar across strata — formally, that there’s no effect modification (interaction) between the exposure and the stratifying variable. If the exposure genuinely works differently in different strata, collapsing them into one number hides that difference rather than adjusting for it, and the strata should be reported separately instead of pooled. The standard check is the Breslow-Day test, which compares each stratum’s observed cell count to what would be expected under one common odds ratio equal to ORMH, and sums a chi-square-type statistic with k−1 degrees of freedom (k = number of strata). In the worked example, the Breslow-Day statistic is 0.64 on 2 degrees of freedom — small relative to its degrees of freedom, consistent with the common-OR assumption the data were built to satisfy. A large Breslow-Day statistic (conventionally compared against a chi-square critical value, e.g. 5.99 at p = 0.05 for 2 df) is the signal to stop pooling and report stratum-specific estimates, or move to a model that explicitly includes an exposure×stratum interaction term.
Mantel-Haenszel vs. logistic regression: when to use which
Both methods adjust for confounding by conditioning on a variable rather than ignoring it, and for a single categorical confounder with reasonably sized strata they typically produce very similar pooled/adjusted odds ratios. The practical differences: Mantel-Haenszel handles many strata with small or sparse cell counts more reliably, because it doesn’t rely on the large-sample asymptotics that maximum-likelihood logistic regression needs to converge and produce trustworthy standard errors — this is precisely why it remains standard for matched or finely stratified case-control data. Logistic regression, in exchange, adjusts for several confounders simultaneously (including continuous ones, without needing to categorize them into strata first), can model interaction terms directly instead of only testing for their presence via Breslow-Day, and generalizes more easily to more complex designs. In practice, MH is often used as a transparent, hand-checkable first pass on one or two categorical confounders, with logistic regression (or conditional logistic regression for matched designs) as the fuller multivariable model.
Common pitfalls
- Treating MH as a substitute for checking homogeneity. Computing ORMH without running Breslow-Day (or at minimum inspecting the stratum-specific ORs by eye) risks reporting one number that masks real effect-modification.
- Over-stratifying a continuous confounder into too many thin strata. Cutting a continuous variable like age into ten bands instead of three or four can leave individual strata with zero cells in one cell of the 2×2 table, which distorts both the point estimate and the variance; coarser, clinically meaningful categories are usually more defensible than maximally fine ones.
- Confusing the Mantel-Haenszel test (a chi-square test of whether ORMH differs from 1) with the Mantel-Haenszel estimator (the pooled OR itself and its confidence interval). A non-significant test does not mean the pooled OR is close to 1 — check the estimate and interval directly rather than relying on the test’s p-value alone.
- Reporting only the crude OR because it was “simpler.” As the worked example shows, the crude estimate can be off by a large margin whenever the stratifying variable is a real confounder; if a stratification variable is available and plausibly confounds the relationship, the pooled estimate is the one that belongs in the results, with the crude figure shown only for contrast.
Frequently asked questions
Is the Mantel-Haenszel method the same as a stratified chi-square test?
They’re closely related but answer different questions. The Cochran-Mantel-Haenszel (CMH) chi-square statistic tests whether the pooled association across strata differs from the null (no association), while the Mantel-Haenszel odds ratio is the actual size of that pooled association with its own confidence interval. Most statistical software reports both from the same procedure (R’s mantelhaen.test(), SAS’s PROC FREQ CMH) because they’re computed from the same stratified tables, but a significant CMH test only tells you the pooled OR differs from 1 — it doesn’t tell you how large that difference is.
Does Mantel-Haenszel require the same number of strata as confounders?
Mantel-Haenszel handles one stratifying variable at a time; if it’s categorical with several levels, or if two confounders are combined into a single joint stratification (e.g. age band × sex), the method still applies directly to that stratification. Adjusting for several confounders that can’t sensibly be combined into a shared set of strata is where multivariable logistic regression becomes the more practical tool.
What if I only have two strata?
The formula works the same way with any number of strata ≥ 2 — it’s a sum over however many strata exist. With very few strata, the Breslow-Day homogeneity check has correspondingly little power to detect real effect modification, so a non-significant result with only two or three strata should be read as inconclusive rather than as strong evidence of homogeneity.
Can Mantel-Haenszel be used for risk ratios or rate ratios instead of odds ratios?
Yes — the same weighted-pooling logic produces a Mantel-Haenszel risk ratio from stratified cohort data and a Mantel-Haenszel rate ratio from stratified person-time data; the odds-ratio version is the one most associated with the method’s original case-control application and the one most software implements by default.
For the underlying single-stratum odds ratio mechanics this method pools, see How to Interpret an Odds Ratio and Confidence Interval for an Odds Ratio. For the confounding concept itself, see the Confounding Variable dictionary entry and Attributable Risk and Attributable Fraction. Mantel-Haenszel’s role as the ancestor of survival-analysis methods is covered in The Log-Rank Test and Its Variants, and its use in matched retrospective designs in Case-Control Study: Design, Odds Ratios, and Common Pitfalls and Nested Case-Control Studies. See the Research Methods & Statistics hub for the full cluster.








