Signature
N_1 = n1_1 + n2_1; N_2 = n1_2 + n2_2; RD_1 = a_1 / n1_1 - c_1 / n2_1; RD_2 = a_2 / n1_2 - c_2 / n2_2; w_1 = n1_1 * n2_1 / N_1; w_2 = n1_2 * n2_2 / N_2; K = w_1 + w_2; J = (a_1 * (n1_1 - a_1) * n2_1^3 + c_1 * (n2_1 - c_1) * n1_1^3) / (n1_1 * n2_1 * N_1^2) + (a_2 * (n1_2 - a_2) * n2_2^3 + c_2 * (n2_2 - c_2) * n1_2^3) / (n1_2 * n2_2 * N_2^2); RD_MH = (w_1 * RD_1 + w_2 * RD_2) / K; SE_RD = sqrt(J / K^2); RD_L = RD_MH - 1.96 * SE_RD; RD_U = RD_MH + 1.96 * SE_RD
| Inputs | Definition | Unit |
|---|---|---|
n1_1 | Patients in the new treatment arm of trial or stratum 1, above 0 | count |
n2_1 | Patients in the comparator arm of trial or stratum 1, above 0 | count |
n1_2 | Patients in the new treatment arm of trial or stratum 2, above 0 | count |
n2_2 | Patients in the comparator arm of trial or stratum 2, above 0 | count |
a_1 | Events in the new treatment arm of trial or stratum 1, at least 0 and at most the arm size | count |
c_1 | Events in the comparator arm of trial or stratum 1, at least 0 and at most the arm size | count |
a_2 | Events in the new treatment arm of trial or stratum 2, at least 0 and at most the arm size | count |
c_2 | Events in the comparator arm of trial or stratum 2, at least 0 and at most the arm size | count |
N_1 | Patients in trial or stratum 1 | count |
|---|---|---|
N_2 | Patients in trial or stratum 2 | count |
RD_1 | Risk on the new treatment minus risk on the comparator in trial or stratum 1 | probability difference |
RD_2 | Risk on the new treatment minus risk on the comparator in trial or stratum 2 | probability difference |
w_1 | Weight n1 n2 / N of trial or stratum 1 | patients |
w_2 | Weight n1 n2 / N of trial or stratum 2 | patients |
K | Sum of the weights over strata | patients |
J | Sum over strata of (a b n2 cubed + c d n1 cubed) / (n1 n2 N squared), with b and d the non-events n1 minus a and n2 minus c | patients |
RD_MH | Pooled risk difference, new treatment minus comparator, negative when the new treatment lowers the risk | probability difference |
SE_RD | Standard error of RD_MH | probability difference |
RD_L | Lower limit of the 95% confidence interval for RD_MH | probability difference |
RD_U | Upper limit of the 95% confidence interval for RD_MH | probability difference |
Function
Mantel-Haenszel pooling and test of association across stratified two-by-two tables
Maps the cell counts of several two-by-two tables, one per trial or stratum, to a pooled odds ratio, risk ratio or risk difference with its standard error, and to a test of association, while keeping each comparison inside its own stratum. HE-FM-MHM-001 to HE-FM-MHM-003 give the estimators and HE-FM-MHM-004 the Cochran-Mantel-Haenszel statistic, each written out for two strata so that the calculator runs. Their Excel rows take any number of strata, and HE-CF-MHM-001 chains all four for three trials. Another common-effect weighting is the inverse-variance estimate HE-FM-ADMA-001, which HE-FM-PWMA-001 feeds for a risk ratio. The risk difference of one trial is HE-FM-ARR-001 with the sign reversed. Applying a pooled ratio to a baseline probability takes the form of HE-FM-NMA-004 for an odds ratio, written there for a network odds ratio, and is HE-FM-ARR-002 for a risk ratio. Notation follows the Mantel-Haenszel Method article.
Try this function
Implementations
Excel
Excel Mantel-Haenszel risk difference from one row per stratum
With the ranges TrialEventsNew, TrialSizeNew, TrialEventsComparator and TrialSizeComparator, one row per stratum, the formulas go in order into RiskDifferenceWeightSum, RiskDifferenceVarianceSum, PooledRiskDifferenceMH, StandardErrorRiskDifferenceMH, RiskDifferenceLowerLimitMH and RiskDifferenceUpperLimitMH. A row left blank returns #DIV/0!, since both of its sizes are treated as 0.
=SUMPRODUCT(TrialSizeNew*TrialSizeComparator/(TrialSizeNew+TrialSizeComparator)); =SUMPRODUCT((TrialEventsNew*(TrialSizeNew-TrialEventsNew)*TrialSizeComparator^3+TrialEventsComparator*(TrialSizeComparator-TrialEventsComparator)*TrialSizeNew^3)/(TrialSizeNew*TrialSizeComparator*(TrialSizeNew+TrialSizeComparator)^2)); =SUMPRODUCT((TrialEventsNew*TrialSizeComparator-TrialEventsComparator*TrialSizeNew)/(TrialSizeNew+TrialSizeComparator))/RiskDifferenceWeightSum; =SQRT(RiskDifferenceVarianceSum/RiskDifferenceWeightSum^2); =PooledRiskDifferenceMH-1.96*StandardErrorRiskDifferenceMH; =PooledRiskDifferenceMH+1.96*StandardErrorRiskDifferenceMH
Assumptions
Both arms populated in each stratum of the Mantel-Haenszel risk difference
Each stratum has patients in both arms, so that n1, n2 and each study risk are defined. A trial with no events in either arm has a risk difference of zero and is included, as Cochrane Handbook section 10.4.4.2 describes for risk difference methods, and its weight is unchanged (derived). The same section reports that Bradburn and colleagues found confidence intervals from all risk difference methods too wide when events are rare.
Common or averaged risk difference in the Mantel-Haenszel pooled estimate
A fixed-effect reading assumes one risk difference common to all strata. When the differences vary, RD_MH is still a weighted average of the stratum values with these weights, as the formula shows, but the weights reflect the group sizes in the trials and not a target population. Cochrane Handbook section 15.4.3 notes that relative effects tend to be substantially more stable across risk groups than absolute effects.
Worked examples
Mantel-Haenszel risk difference of the article's two illustrative trials
Both of the article's illustrative trials have a risk difference of -0.100, so the pooled value is -0.100 whatever the weights, as in the article. The weights are 50 and 66.667, and the standard error of 0.0434 gives limits of -0.1852 and -0.0148. The collapsed table would give -0.0667.
a_1 = 20; n1_1 = 100; c_1 = 30; n2_1 = 100; a_2 = 80; n1_2 = 200; c_2 = 50; n2_2 = 100; N_1 = 200; N_2 = 300; RD_1 = -0.1; RD_2 = -0.1; w_1 = 50; w_2 = 66.6667; K = 116.6667; J = 25.6944; RD_MH = -0.1; SE_RD = 0.0434; RD_L = -0.1852; RD_U = -0.0148
Illustrative Mantel-Haenszel risk difference when stratum effects differ
Trial A is paired with an illustrative trial randomised 2 to 1 with 60 of 200 events against 25 of 100, a risk difference of 0.05. The weights of 50 and 66.667 give a pooled value of -0.0143. Weighting by total patients would give -0.01 and the collapsed table -0.0083, so the choice of weight changes the answer only when the stratum effects differ.
a_1 = 20; n1_1 = 100; c_1 = 30; n2_1 = 100; a_2 = 60; n1_2 = 200; c_2 = 25; n2_2 = 100; N_1 = 200; N_2 = 300; RD_1 = -0.1; RD_2 = 0.05; w_1 = 50; w_2 = 66.6667; K = 116.6667; J = 22.25; RD_MH = -0.0143; SE_RD = 0.0404; RD_L = -0.0935; RD_U = 0.065
Illustrative trial with no events in either arm in a Mantel-Haenszel risk difference
An illustrative trial of 50 against 50 with no events is pooled with trial A. Its risk difference of zero carries a weight of 25, so the pooled value moves to -0.0667 against -0.100 for trial A alone.
a_1 = 0; n1_1 = 50; c_1 = 0; n2_1 = 50; a_2 = 20; n1_2 = 100; c_2 = 30; n2_2 = 100; N_1 = 100; N_2 = 200; RD_1 = 0; RD_2 = -0.1; w_1 = 25; w_2 = 50; K = 75; J = 9.25; RD_MH = -0.0667; SE_RD = 0.0406; RD_L = -0.1461; RD_U = 0.0128
Common errors
Subtracting risks from aggregated totals across trials
Cochrane Handbook section 15.4.4 warns against computing risk differences from aggregated totals because the approach ignores the randomisation within studies and may produce seriously misleading results when any study has unbalanced randomisation. In the article's example both trials lower the risk by 10 percentage points, yet the collapsed table gives 6.7 points. HE-ER-ARR-001 records the same warning.
Weighting the Mantel-Haenszel risk difference by total patients
The weight is n1 n2 / N, not N. Under 1 to 1 allocation the weight is N / 4 in every stratum, so the two schemes agree, and the gap appears when allocation varies between strata with different effects (derived). In the illustrative example with unequal effects, total patients give -0.01 against the correct -0.0143.
Dropping trials with no events from a Mantel-Haenszel risk difference
Trials without events are excluded from odds ratio and risk ratio analyses, but Cochrane Handbook section 10.4.4.2 notes that the risk difference is defined as zero and such studies are included. Dropping the trial in the illustrative example moves the pooled value from -0.0667 to -0.100 (derived), so a report states how these trials were handled.
Sources
RevMan statistical algorithms for the Mantel-Haenszel risk difference and its standard error
Deeks JJ, Higgins JPT. Statistical algorithms in Review Manager. Cochrane Statistical Methods Group; May 2022. Section Mantel-Haenszel methods for combining results across studies, subsection Risk difference. Equation 5 gives the summary risk difference with weight n1 n2 / N, and equation 6 gives its standard error as the square root of J over K squared, with J and K as printed.
Cochrane Handbook chapter 15 on aggregated totals and stability of effects
Schünemann HJ, Vist GE, Higgins JPT, Santesso N, Deeks JJ, Glasziou P, Akl EA, Guyatt GH. Chapter 15: Interpreting results and drawing conclusions (last updated August 2023). In: Higgins JPT, Thomas J, Chandler J, Cumpston M, Li T, Page MJ, Welch VA (editors). Cochrane Handbook for Systematic Reviews of Interventions version 6.5. Cochrane; 2024. Section 15.4.3 (relative effects tend to be substantially more stable across risk groups than absolute effects) and section 15.4.4 (risk differences should not be computed from aggregated totals across trials).
Cochrane Handbook chapter 10 on risk differences in trials with no events
Deeks JJ, Higgins JPT, Altman DG, McKenzie JE, Veroniki AA, Simmonds M (editors). Chapter 10: Analysing data and undertaking meta-analyses (last updated November 2026). In: Higgins JPT, Thomas J, Chandler J, Cumpston M, Li T, Page MJ, Welch VA (editors). Cochrane Handbook for Systematic Reviews of Interventions version 6.5.1. Cochrane; 2026. Section 10.4.4.2 (the risk difference is defined as zero when no events occur in either arm, such studies are included, and Bradburn and colleagues found the confidence intervals of risk difference methods too wide when events are rare).
Canonical Identity
Stable URI · Machine-readable · Resolvable · CC BY 4.0
