WorksMathematics
The Cochran–Mantel–Haenszel test as a test of the average treatment effect in stratified randomized trials
Abstract
This note revisits the Cochran–Mantel–Haenszel (CMH) test in light of the increasing use of causal inference methods in clinical trials. It shows that the CMH test statistic can be interpreted as a standardized version of the augmented inverse probability weighted (AIPW) estimate of the causal average treatment effect. Consequently, it is not restricted to an interpretation as a test of the common-odds ratio in a stratified logistic regression model. The note then discusses conditional and unconditional variances for this estimator as well as variance estimation and its implications for testing. The results clarify the relationship between the classical conditional CMH test and Wald-type AIPW tests, and show that, under equal treatment allocation, the CMH test is an asymptotically exact test of the weak null hypothesis of zero average treatment effect, without any restriction on the heterogeneity of stratum-specific effects. Under unequal allocation, it can be liberal or conservative. A simulation study supports these findings.
Introduction
The Cochran–Mantel–Haenszel (CMH) test [9] has been a workhorse of statistical inference for binary endpoints in clinical trials for decades. In textbooks, it is usually introduced as a test of the null hypothesis that the common odds ratio is 1 in a logistic regression model with a treatment effect and a stratum effect but no interaction, against the alternative that this common odds ratio differs from 1.
In recent years, causal inference has become more prominent in clinical trials. This has led to increased awareness of the role of covariates in the analysis of clinical trial data. Methods such as augmented inverse probability weighting (AIPW) [15, 7] are now applied in clinical trials, since it has been recognized that these methods allow unbiased estimation of treatment effects under weaker model assumptions than those required by the linear and nonlinear regression models that had been predominant before; see, for example, Ye et al. [ [16] and Ye et al. [ [17].
In this note, we revisit the CMH test from a causal inference perspective. Under stratified randomization, the numerator of the CMH statistic is an unbiased estimator of the average treatment effect (ATE). It coincides with the AIPW, IPW and standardization estimators for any outcome model using the stratification as the only factor. The question addressed here is therefore not which estimator to use, but how to standardize it for testing.
The paper is organized as follows: In § 1.1, we quickly review the CMH test, representing it in a form that allows the connection with AIPW-estimation. § 2 establishes this connection: under stratified randomization, the AIPW estimator coincides with , the estimator in the numerator of the CMH statistic, for any outcome model that depends on the stratum only, whether saturated or not and whether correctly specified or not. § 3 considers different variance estimators of the AIPW point estimate and discusses their appropriateness for different situations. § 4 discusses the consequences of using these different variance estimates in testing. § 5 shows that under 1:1 randomization the CMH test also controls the type I error for the weak null hypothesis of zero average treatment effect. § 6 compares the CMH test with the Wald test based on the AIPW estimator by simulation. The paper concludes with a discussion.
The CMH test as a test of weighted averages of stratum-specific risk differences
We are investigating a binary response and the comparison of two treatments in a clinical trial where denotes subjects, treatment group of subject and enumerates the categories of a stratification factor with being subject ’s stratum. We will from now on drop the index from , when possible without ambiguity. In stratum , let denote the number of patients assigned to treatment , and let denote the number of responses among those patients.
Furthermore, assume that stratified randomization fixes the treatment fraction within each stratum, such that
with the same allocation fraction for all strata.
Define the observed within-stratum response proportions and the pooled within-stratum response proportion
The Cochran–Mantel–Haenszel test statistic can then be written as
A slightly simpler large-sample approximation is
Under the strong null hypothesis for every stratum , is asymptotically -distributed.
Connection with AIPW estimation
Let denote stratum and treatment assignment, both interpreted as random variables. Every subject belongs to a stratum with , , where .
Due to stratified randomization, we have , the same in every stratum. Thus , . As the ATE, we use the population-average causal risk difference which is defined as
Considering the subjects as a sample from a stratified population with subjects from stratum , we have
The estimator of the marginal risk difference is
This estimator is unbiased for :
Taking expectation again over the multinomial distribution of ,
Comparing with equation (1), we see that due to , the numerator of the CMH test statistic is
Hence, under stratified randomization with common treatment fraction , the square root of the CMH test statistic can be viewed as a standardized version of the estimator of the population-average risk difference. Its numerator estimates the marginal risk difference, while its denominator estimates the corresponding null standard deviation used for hypothesis testing.
Regarding the connection with AIPW estimation, let and be the realizations of and , respectively, of patient . An AIPW estimate of the treatment effect then has the form where
and
In this setup denotes the estimated response of a randomly selected patient in treatment group and stratum from some outcome model predicting the response. The estimator is consistent under very mild regularity conditions in a causal inference framework even if the outcome model is misspecified [see e.g. Tsiatis, 2006].
We use an outcome model with a separate response probability for every cell . It is well known that with such a saturated model, standardization, IPW and AIPW all give the same estimate [11, 7].
Because stratified randomization assigns the same fraction of patients to treatment in every stratum, both treatment arms have exactly the same stratum composition. There is therefore no imbalance between the arms for any adjustment to correct. Irrespective of whether the outcome model is correct or not, the terms involving cancel such that simplifies to the difference between the overall response proportions of the two arms, i.e.
Stratification is only relevant to the variance used to standardize this estimate for testing, which is the subject of § 3–§ 5.
In this note, the strata are the only covariates. The outcome model is a function of the stratum alone. Additional baseline covariates could be included in . This would lead to a non-saturated AIPW estimator for which the exact identities above no longer hold. This is not considered here. The outcome model serves only as a device for estimating . We also note that the AIPW estimator has the form of the generalized regression (GREG) estimator of survey sampling [12].
We emphasize that the exact equivalence between the CMH numerator and the AIPW estimator relies on the treatment fraction being the same in every stratum. In general, the CMH numerator is
i.e. a weighted sum of the stratum-specific risk differences with weights , . These weights reflect both the size of a stratum and how balanced the allocation within it is. Only if for all are they proportional to , so that the numerator is proportional to . Otherwise the CMH numerator estimates a differently weighted average of the true stratum-specific risk differences , which coincides with only if all are equal. The CMH test then remains a valid test of the strong null hypothesis, but its connection to is lost. Under stratified block randomization the realized differ from only through incomplete final blocks, so that the discrepancy is of order and negligible for all practical purposes. Under simple randomization without stratification, the still converge to , but only at rate . The two estimators are then both consistent for , but if the stratum-specific effects differ, their difference is of the same order as their standard error, so their asymptotic variances are not the same. We do not pursue this case further.
Variance of
This section considers under different degrees of conditioning. The distinction between conditional and unconditional variances of post-stratified estimators is not new. Miratrix et al. [ [10] give a detailed treatment for general outcomes, both for post-stratification after complete randomization and for blocked designs. The expressions below are the corresponding results for a binary endpoint under stratified randomization with a common allocation fraction. We present them here because they make explicit how the denominator of the CMH statistic relates to these variances, which is the basis for § 4 and § 5.
Conditional variance given and
The CMH test conditions on the observed stratum sizes and the observed total number of responses in each stratum, . Under the strong null hypothesis
the conditional distribution of given and is hypergeometric:
Its conditional mean and variance are
and
Since
and is fixed under this conditioning, only is random. Rewriting
one obtains
For large , this is approximated by
Hence, the CMH statistic can be written as
Conditional variance given only
If one conditions only on the observed stratum sizes , but not on the observed total responses , then under the data-generating model
independently across treatment groups within each stratum. Hence
and
Under the strong null hypothesis for all , this simplifies to
A plug-in estimator replaces by , yielding
which coincides with the large-sample approximation to the conditional CMH variance above. Thus the familiar large-sample CMH test can also be seen as using the null variance of conditional only on the stratum sizes .
Alternatively, one may estimate the variance conditional on by plugging the observed treatment-specific proportions and directly into equation (4). Under the null hypothesis, the null-based and general plug-in versions are asymptotically equivalent. Away from the null, however, they differ.
Unconditional variance
The unconditional variance can be obtained via the law of total variance:
From equation (3),
Using ,
and
It follows that
Taking expectation over the multinomial distribution (cf. equation (4)) gives
Combining terms,
where denotes the variance of the random variable taking the value with probability .
Compared with the variance conditional on , the unconditional variance contains the additional term , which reflects random variation in the stratum composition. It vanishes when all are equal.
Choice of variance estimate for testing
The CMH test uses the variance conditional on the observed and , yielding an exact conditional test if the exact hypergeometric distribution is used, and an asymptotic -test when the variance is plugged into the usual quadratic form.
By contrast, a causal inference interpretation would view the parameter as a marginal superpopulation parameter. Typically, Wald-type inference would be used to estimate the unconditional variance corresponding to repeated sampling from the superpopulation. In the present discrete-strata randomized setting, that variance is given by equation (5). In practice, the unknown parameters in the formula are replaced by their sample analogues and .
Since the CMH numerator coincides with the AIPW estimator in the present setting, the relevant comparison is not between different point estimators but between different variance choices for the same estimator. Two distinctions should be kept separate. First, one may use a variance conditional on the observed stratum composition or an unconditional variance that also averages over random stratum composition. Second, one may estimate the variance under the null hypothesis or under the unrestricted model. The classical CMH test uses a conditional null-based variance, whereas Wald-type inference for AIPW estimators usually uses an unrestricted variance, often in its unconditional superpopulation form.
In the binary case, the null-based pooled variance is generally larger than the unrestricted plug-in variance away from the null. For example, for balanced randomization , the large-sample null-based variance conditional on exceeds the unrestricted conditional variance by
Thus, null-based variance estimation may reduce the value of the test statistic under alternatives. This suggests a potential power advantage for tests based on the unrestricted plug-in variance estimator. In practice, however, that advantage is often tempered by the estimator’s poor finite-sample behavior (see also § 6). In small or moderately sized samples, with many strata, or when some stratum-by-treatment cells are sparse or have response probabilities close to 0 or 1, the factors become too small and hence tend to underestimate the corresponding variance components. Moreover, the estimated between-stratum component in the unconditional variance is unreliable when it is based on few strata. The resulting Wald tests will therefore be anticonservative in many cases. Null-based or pooled variance estimators are often preferred for testing in comparative binomial problems precisely because they are more stable in such settings, even though they are larger than the unrestricted plug-in variance away from the null; see, for example, [1990], [2003], and [2013].
Consequences for testing
§ 3 clarifies the role of conditioning in tests based on . If inference is carried out conditionally on the observed stratum sizes, variation due to random stratum composition is removed. In the unrestricted variance decomposition, the difference between the unconditional variance and the variance conditional on is . This term vanishes only if the stratum-specific risk differences are all equal. Thus, conditional inference removes a source of variation that is unrelated to the treatment comparison within the realized stratum composition of the trial. For hypothesis testing, this conditional perspective has a natural appeal. If a test has a conditional type I error of at most for every value of the conditioning statistic, then it also has unconditional type I error of at most , since
Thus, conditioning on the observed stratum composition does not compromise type I error control under the strong null hypothesis for all . Rather, it eliminates from the test statistic the extra variation due to random stratum sizes. This is particularly attractive in randomized clinical trials, where the stratum composition is observed before the outcome analysis and the primary comparison is between randomized treatment groups within the realized trial population.
This argument is distinct from the question whether the variance is estimated under the null or under the unrestricted model. The classical CMH statistic combines both features: it conditions on the observed and , and it uses a null-based pooled variance. An unrestricted AIPW Wald test, in contrast, typically uses an unrestricted variance estimator and may also use an unconditional superpopulation variance. A direct comparison between the two therefore mixes two effects: conditioning tends to remove variation from random stratum composition, whereas null-based pooling can increase the denominator under alternatives. At , these two effects almost cancel: the null-based pooled variance exceeds the unrestricted conditional variance by , whereas the unconditional variance exceeds it by . The CMH denominator is therefore larger by only , which is of second order under local alternatives. The simulations in § 6 are in line with these theoretical expectations.
Consequently, the main point is not that the CMH test must have uniformly higher power than an unrestricted AIPW Wald test. Under strict Pitman local alternatives the differences discussed above are of second order, and under fixed alternatives both tests are consistent. Rather, the point is that the CMH test is a valid test based on the same stratified ATE estimator, without requiring the common-odds-ratio model often used to motivate it. It controls the type I error under the strong null hypothesis for any allocation ratio and, as shown in § 5, under the weak null hypothesis when allocation is 1:1.
Asymptotic type I error for different versions of null hypotheses
First, consider the one-sided CMH test (comparing the root of the test statistic, signed by , with the corresponding -quantile) as an asymptotic level- test of the strong null hypothesis for all , conditionally on the observed stratum sizes and hence, by the argument of § 4, also unconditionally. It can be re-interpreted as a test of the composite null hypothesis “no benefit in any stratum”,
against the restricted alternative “no harm in any stratum and benefit in at least one stratum”,
Within this , for all is the least favourable configuration: there the rejection probability converges to , while at every other point some , hence , and the rejection probability converges to 0. The one-sided CMH test is therefore an asymptotic level- test of this pair of hypotheses for any allocation ratio .
This interpretation excludes configurations with benefit in some strata and harm in others, in which effects of opposite sign can cancel such that . This motivates the weak null hypothesis
Under this weak null, the conditioning argument of § 4 is no longer available: given the realized stratum sizes, is in general not zero. We therefore derive the unconditional asymptotic distribution of the CMH statistic, treating as multinomial.
Let
By equation (5), under the weak null, where ,
For the denominator of the CMH statistic, in probability, and
where we used the identity . The same limit applies to the finite-sample version in equation (1) with the factors . Hence, using ,
with
Numerator and denominator differ only by
Two conclusions follow immediately:
Under balanced allocation , for every configuration of satisfying the weak null. The CMH test is therefore an asymptotically exact level- test of the weak null hypothesis . The null-based pooled variance in its denominator exceeds the within-stratum variance by exactly the amount of between-stratum variation that the random stratum composition adds to the variance of .
Under unequal allocation , in general. The test is liberal () if , i.e. if the larger treatment arm has, on average, the smaller binomial variance, and conservative otherwise.
This parallels the classical result that pooled-variance two-sample tests are robust to variance heterogeneity only under equal allocation [13]; see also Bugni et al. [2018] for an analogous result under covariate-adaptive randomization.
If the nominal critical value is , the asymptotic rejection probability is
To illustrate the magnitude of deviations from nominal in extreme cases, consider strata with , for all , and , such that with . At , the asymptotic rejection probability is 5% for , about 2.5% for and about 8.7% for . For practically more relevant, less extreme settings, the finite-sample accuracy of the asymptotic rejection probabilities is examined in § 6.
Simulation
Design
We compare the CMH test with the Wald test based on the same estimator in trials with or patients, or strata, and allocation 1:1 () or 2:1 (). The stratum probabilities and control response rates are
The unequal were chosen such that some strata are small, in particular for and , where the smallest stratum has an expected size of 4 patients.
The response probabilities in the treatment arm are where is determined as follows:
Strong null: for all .
Weak null: with . Hence, alternates in sign and is shifted such that . For , this gives , respectively.
Power, homogeneous: for all .
Power, heterogeneous: with the same as for the weak null.
The effect gives a power of about 75% for and 1:1 allocation. In each simulated trial, the stratum sizes were drawn from the multinomial distribution, the treatment arm in stratum received patients, mimicking stratified block randomization, and the numbers of responders were drawn from the binomial distributions. No restrictions are imposed, so that empty strata and strata in which one arm is empty (in particular strata with a single patient) occur. There were 100,000 replications per setting. The Monte Carlo standard error of a rejection rate is about 0.05 percentage points at 2.5% and about 0.16 percentage points at 50%.
The CMH test uses statistic (1) without continuity correction. The Wald test uses with the plug-in version of the unconditional variance (5),
Both tests are carried out one-sided at the nominal level of 2.5%, as usual for superiority trials: for the CMH test, the signed root , and for the Wald test , is compared with .
To separate the power of the two tests from their size, we also report size-adjusted power: for each combination of , and , the empirical 97.5% quantile of each signed statistic in the strong-null scenario was used as critical value in the two power scenarios. This is a benchmark for a fair power comparison only. It is not a practical remedy for the liberality of the Wald test, since the critical value depends on the unknown and and, under the weak null, on the unknown configuration of the . To check that the results do not depend on control proportions being mostly below 0.5, we repeated all settings with mirrored proportions, and , which leaves all unchanged.
Empty strata and empty arms. A stratum in which one arm is empty contributes nothing to the CMH statistic: its weight in the numerator and its contribution to the variance are both zero. In our implementation such strata are simply omitted, which leaves the statistic unchanged. For the Wald test, in contrast, no estimate is available for such a stratum. We dropped these strata and rescaled the weights of the remaining strata to sum to 1. Strictly speaking, this changes the estimand to the average treatment effect over the strata in which both arms are observed, which is somewhat awkward, since a stratum is then excluded merely because it happened to be represented by too few patients. Empty strata () receive weight 0 in both tests and are irrelevant. With and , about 10% of the simulated trials contain at least one empty stratum or a stratum with an empty arm (Table 1, column Drop.). Otherwise, this is rare.
| Alloc. | Scenario | As. | Nominal CMH | Nominal Wald | Size-adj. CMH | Size-adj. Wald | Crit. values CMH | Crit. values Wald | Drop. | ||
| 4 | 100 | 1:1 | strong null | 2.50 | 2.42 | 2.94 | — | — | 1.95 | 2.03 | 0.03 |
| weak null | 2.50 | 2.46 | 2.93 | — | — | 0.04 | |||||
| power, hom. | — | 46.5 | 48.7 | 47.0 | 46.9 | 0.04 | |||||
| power, het. | — | 45.8 | 47.7 | 46.4 | 46.2 | 0.04 | |||||
| 4 | 100 | 2:1 | strong null | 2.50 | 2.36 | 3.73 | — | — | 1.94 | 2.16 | 0.03 |
| weak null | 2.46 | 2.30 | 3.63 | — | — | 0.03 | |||||
| power, hom. | — | 41.1 | 46.5 | 42.1 | 39.5 | 0.03 | |||||
| power, het. | — | 40.0 | 45.8 | 41.2 | 38.7 | 0.04 | |||||
| 4 | 200 | 1:1 | strong null | 2.50 | 2.62 | 2.87 | — | — | 1.98 | 2.02 | 0.00 |
| weak null | 2.50 | 2.40 | 2.69 | — | — | 0.00 | |||||
| power, hom. | — | 75.3 | 76.1 | 74.8 | 74.8 | 0.00 | |||||
| power, het. | — | 74.7 | 75.2 | 73.8 | 73.8 | 0.00 | |||||
| 4 | 200 | 2:1 | strong null | 2.50 | 2.39 | 3.12 | — | — | 1.94 | 2.07 | 0.00 |
| weak null | 2.46 | 2.31 | 3.10 | — | — | 0.00 | |||||
| power, hom. | — | 69.6 | 72.1 | 70.2 | 68.5 | 0.00 | |||||
| power, het. | — | 68.4 | 71.4 | 69.3 | 67.8 | 0.00 | |||||
| 8 | 100 | 1:1 | strong null | 2.50 | 2.48 | 3.26 | — | — | 1.95 | 2.08 | 10.4 |
| weak null | 2.50 | 2.48 | 3.19 | — | — | 10.4 | |||||
| power, hom. | — | 45.9 | 50.6 | 46.2 | 46.1 | 10.3 | |||||
| power, het. | — | 45.7 | 50.3 | 46.0 | 45.7 | 10.5 | |||||
| 8 | 100 | 2:1 | strong null | 2.50 | 2.31 | 4.00 | — | — | 1.93 | 2.21 | 10.5 |
| weak null | 2.55 | 2.41 | 4.03 | — | — | 10.5 | |||||
| power, hom. | — | 41.2 | 48.9 | 42.5 | 40.2 | 10.4 | |||||
| power, het. | — | 41.3 | 48.4 | 42.5 | 39.8 | 10.4 | |||||
| 8 | 200 | 1:1 | strong null | 2.50 | 2.58 | 2.94 | — | — | 1.97 | 2.03 | 0.28 |
| weak null | 2.50 | 2.45 | 2.79 | — | — | 0.25 | |||||
| power, hom. | — | 75.5 | 77.2 | 75.1 | 75.1 | 0.26 | |||||
| power, het. | — | 75.3 | 77.0 | 74.9 | 74.8 | 0.27 | |||||
| 8 | 200 | 2:1 | strong null | 2.50 | 2.40 | 3.33 | — | — | 1.94 | 2.10 | 0.30 |
| weak null | 2.55 | 2.46 | 3.29 | — | — | 0.26 | |||||
| power, hom. | — | 70.2 | 73.6 | 70.7 | 69.2 | 0.31 | |||||
| power, het. | — | 69.8 | 73.0 | 70.4 | 68.6 | 0.27 |
Table 1. Simulated one-sided rejection rates (%, upper tail, nominal level 2.5%) of the CMH test and the Wald test for the stratified ATE estimator; 100,000 replications per setting. Alloc.: allocation ratio treatment:control. As.: asymptotic one-sided rejection rate of the CMH test from Section 6. Nominal: rejection rates with the critical value . Size-adj.: power with the critical values in the columns Crit. values, i.e. the empirical 97.5% quantiles of the signed statistics under the strong null for the same , and allocation. Drop.: percentage of trials with at least one empty stratum or one stratum with an empty arm.
Results
The results are shown in Table 1. The table contains the upper-tail rates for the original settings only. Lower-tail rates and the results for the mirrored settings reported in the text are given in the Supplementary Material.
Type I error. The CMH test keeps the one-sided nominal level of 2.5% well in all settings, with rejection rates between 2.30% and 2.62%, under both the strong and the weak null hypothesis, even for and with strata of only a few patients. This confirms the well-known observation that the asymptotic CMH test does not require large strata, but only a sufficiently large total sample size; see, for example, Mantel and Fleiss [1980]. The Wald test is liberal in all settings, with rejection rates between 2.69% and 4.03%. The excess is largest with more strata, smaller samples and unequal allocation, i.e. when stratum-by-treatment cells are small, and it decreases with increasing . This is in line with the arguments at the end of § 3: the factors in small cells tend to underestimate the corresponding variance components.
Asymmetry under unequal allocation. Under 1:1 allocation, the rejection rates of both tests in the upper and the lower tail are practically equal. Under 2:1 allocation, the Wald test is clearly more liberal in the upper tail, which is the relevant one for superiority testing (3.10–4.03%), than in the lower tail (2.49–3.25%). The reason is that the smaller control arm dominates the variance, with weight against for the treatment arm. Since most are below 0.5, a control proportion that happens to be low increases and at the same time decreases and hence . Large positive values of the Wald statistic are therefore inflated, while negative values are not. Under 1:1 allocation, the two arms contribute symmetrically and this effect largely cancels. The CMH test, whose pooled variance does not depend on the arm-specific proportions, shows only a slight asymmetry in the opposite, conservative direction (upper tail 2.30–2.46%, lower tail 2.48–2.73% under 2:1 allocation). In the mirrored settings, both asymmetries are reversed: for the Wald test, upper tail 2.54–3.28% and lower tail 3.07–4.01%; for the CMH test, upper tail 2.49–2.67% and lower tail 2.26–2.44%.
Weak null hypothesis. The simulated rejection rates of the CMH test under the weak null agree with the asymptotic rates obtained from equation (6) for the same settings (column As.). For 1:1 allocation, the asymptotic rate is exactly 2.5%. The simulated rates are 2.40–2.48%. For 2:1 allocation, the asymptotic rates are 2.46% () and 2.55% (), and the simulated rates are 2.30–2.46%, reflecting in addition the slight conservativeness of the upper tail noted next. above. With the moderate heterogeneity used here, the deviation of from 1 is small. The example at the end of § 5 shows that it can be considerably larger for stronger heterogeneity and more extreme allocation.
Power. With nominal critical values, the Wald test has higher power than the CMH test, by up to 7.7 percentage points (, , 2:1). This difference is due to the inflated type I error of the Wald test. After size adjustment, the power of the two tests is practically identical under 1:1 allocation (differences of at most 0.3 percentage points), and the CMH test is ahead by 1.5 to 2.7 percentage points (if the CMH test critical value is adjusted downwards) or 0.6 to 1.6 percentage points (if the nominal level is used for CMH) under 2:1 allocation. The result for 1:1 allocation agrees with § 4: the null-based pooled variance of the CMH test exceeds the unconditional variance used by the Wald test by only , which is negligible here. Under unequal allocation, the pooled variance in addition weights the arm-specific binomial variances and with and instead of and , which asymptotically gives the Wald test a slight advantage in our power settings, where the larger treatment arm mostly has the larger binomial variance. In finite samples, this is outweighed by the upward skewness of the Wald statistic, which requires a considerably larger size-adjusted critical value (2.07–2.21 instead of 1.96). The potential power advantage of estimating the variance without restriction, discussed in § 3, is therefore small in these settings, and its sign depends on the configuration: in the mirrored settings, the size-adjusted power under 2:1 allocation is slightly higher for the Wald test (by 0.5 to 1.0 percentage points). Hence, neither test has a consistent power advantage. The robust difference between the two tests is the type I error.
Heterogeneity. Heterogeneous treatment effects reduce the power of both tests by at most about one percentage point compared with homogeneous effects of the same . This reflects the additional variance term , which is small compared with the within-stratum variance for the heterogeneity considered here.
Two-sided testing. For two-sided tests at the 5% level (not shown in detail), the CMH test again keeps the level (4.79–5.19%), and the Wald test is liberal (5.36–7.24%). Since a two-sided test counts both tails, the asymmetry of the Wald test is partly hidden: its two-sided rate overstates the lower-tail error and understates the upper-tail error. Accordingly, two-sided size adjustment does not fully correct the upper tail, and the Wald test then even appears slightly more powerful under 2:1 allocation (by 0.2–1.1 percentage points). For one-sided superiority testing, this comparison is misleading.
In summary, the CMH test controls the type I error in all settings studied, without relevant loss of power, in line with § 4 and § 5.
Discussion
In this note, we showed that the Cochran–Mantel–Haenszel test for the stratified comparison of a binary response to two treatments can be viewed as a test of the causal ATE in a study with covariate adjustment for one or several categorical covariates for which stratified randomization is feasible. If more than one such covariate exists, they can be combined into a single one by taking the product of their categories. We further showed that the CMH test statistic can be interpreted as a standardized version of an estimate of the ATE that is unbiased by randomization alone and coincides with the AIPW estimate, irrespective of the outcome model used.
Regarding variance estimation and the closely related power of corresponding tests, we showed that the CMH test
preserves the type I error under a strong null hypothesis of no treatment effect in any stratum, either asymptotically or exactly when the exact conditional version is used,
is an asymptotically exact test of the weak null hypothesis of zero average treatment effect in the practically important case of equal randomization to the two treatments, irrespective of how the treatment effect varies across strata. Under unequal randomization, it can be liberal or conservative, although in the realistic settings of § 6 the deviation from the nominal level is small.
Of these observations, the first has long been well known. Nevertheless, it is useful to recall that the CMH test is valid under substantially weaker assumptions than suggested by the common textbook presentation as a test of a common odds ratio in a logistic regression model without treatment-by-stratum interaction.
The second statement about the weak null hypothesis arises because, under equal allocation, the null-based pooled variance in the CMH denominator automatically includes the between-stratum variation of the treatment effect, so that no separate estimate of that component is needed.
The comparison with AIPW also highlights an important practical distinction between point estimation and testing. Modern covariate-adjusted estimators, including AIPW-type estimators proposed for randomized trials target marginal treatment effects and can improve the precision of point estimation relative to unadjusted estimators. However, the large-sample variance theory underlying these methods is often fragile in finite samples. When the number of strata is large relative to the sample size, or when there is substantial heterogeneity across strata, some stratum-by-treatment cells will be small or have observed response proportions close to 0 or 1. The unrestricted plug-in variance then becomes unstable and will usually underestimate the true variability, leading to liberal Wald-type tests.,
This issue is distinct from the causal interpretation of the point estimator. Under stratified randomization, the CMH statistic and the AIPW Wald statistic share the same numerator , and under equal allocation and the weak null hypothesis their variance estimates also converge to the same limit, the true variance of . The remaining difference is that between a score-type and a Wald-type test of the same parameter: the CMH test estimates the variance under the null, pooling treatment arms within strata, whereas the AIPW Wald test estimates it without restriction, cell by cell, and must in addition estimate the between-stratum variation of the treatment effect from the observed strata. The two tests therefore have the same first-order asymptotic properties but can behave noticeably differently in finite samples with sparse cells or response proportions near 0 or 1. For hypothesis testing, it is therefore the choice of variance estimator, not of the point estimator, that matters, and asymptotic equivalence does not guarantee comparable type I error control in finite samples. The simulations in § 6 illustrate this. The CMH test keeps the nominal level in all settings and in both tails, whereas the Wald test is liberal throughout. Under unequal allocation, the excess type I error of the Wald test is concentrated in one tail, depending on whether the control proportions are mostly below or above 0.5. A two-sided analysis partly hides this. The power advantage of the Wald test at nominal critical values is due to its inflated type I error. After size adjustment, neither test has a consistent power advantage. Hence, in the settings studied, the CMH test gives up no relevant power in exchange for reliable type I error control.
The finite-sample behavior of the Wald test can be improved in various ways, for example by small-sample corrections of the variance estimator and the degrees of freedom [3], by adding pseudo-observations to sparse cells [2], by bootstrapping, or by calibrating the critical value under the null hypothesis. A systematic comparison of such variants is beyond the scope of this note. We note, however, that these corrections add choices that must be prespecified and in general control the type I error only approximately. With sparse cells, bootstrap resamples suffer from the same empty arms and boundary proportions as the original data. Calibration under the strong null hypothesis by permuting treatment labels within strata, keeping the stratum sizes and the response totals fixed, leads to the exact conditional distribution of , i.e. to the exact CMH test. In this sense, the CMH test is itself the natural stabilized version of a test based on , and it is available in closed form in all standard software.
Which null hypothesis does the CMH test actually test? Under equal allocation, it is a valid test of the weak null hypothesis , without any restriction on how the treatment effect varies across strata. For any allocation ratio, the one-sided test is also a valid test of “no benefit in any stratum” against “no harm in any stratum and benefit in at least one stratum”. Such restricted alternatives may appear awkward and can have undesirable properties [14]. However, the weak null of zero average treatment effect is not necessarily the clinically more relevant hypothesis. In clinical trials, strata are very rarely a random sample from a well-defined super-population. Their composition reflects design choices, geography, eligibility criteria, and patterns of participation. If stratum-specific effects differ in sign, merely states that benefit and harm cancel for this particular stratum composition, not that the treatment is without effect. In such a situation, neither a test of the weak null nor a test against the restricted alternative answers a relevant clinical question. The heterogeneity itself would have to be addressed.
Overall, the main contribution of this note is to clarify that the CMH test can be understood not only through the traditional common-odds-ratio framework, but also as a test of the average treatment effect based on an estimator that is unbiased by randomization alone. This perspective connects a classical stratified analysis tool with modern causal inference. It also clarifies a practically important point: in stratified randomized trials with binary endpoints, the asymptotic elegance of unrestricted AIPW inference does not eliminate finite-sample concerns arising from sparsity, boundary estimates, and treatment-effect heterogeneity across strata. In such settings, the conditional nature and pooled variance structure of the CMH test can remain attractive for testing, even when AIPW methods are preferred for point estimation or for other estimands.
Acknowledgements
I thank my colleagues Dominic Magirr and Lillian Yau for helpful discussions about the topic. AI tools, including ChatGPT and Claude Opus, were used during the preparation of this manuscript to identify relevant literature, to suggest and check derivations and arguments, to write R code for implementation and simulation, to draft preliminary text, and for stylistic revision. All suggestions were checked by the author. The conceptual framing, final selection of arguments, interpretation of results, and responsibility for the final manuscript remain with the author.
References
- [2]Alan Agresti and Brian Caffo. Simple and effective confidence intervals for proportions and differences of proportions result from adding two successes and two failures. The American Statistician, 54(4):280–288, 2000.DOI
- [3]Robert M. Bell and Daniel F. McCaffrey. Bias reduction in standard errors for linear regression with multi-stage samples. Survey Methodology, 28(2):169–181, 2002.
- [7]Miguel A. Hernán and James M. Robins. Causal Inference: What If. Chapman and Hall CRC, Boca Raton, 2020. ISBN 9781420076165.
- [9]Nathan Mantel and William Haenszel. Statistical aspects of the analysis of data from retrospective studies of disease. Journal of the National Cancer Institute, 22(4):719–748, 1959.
- [10]Luke W. Miratrix, Jasjeet S. Sekhon, and Bin Yu. Adjusting treatment effect estimates by post-stratification in randomized experiments. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 75(2):369–396, 2013. doi: 10.1111/j.1467-9868.2012.01048.x.DOI
- [11]Paul R. Rosenbaum. Model-based direct adjustment. Journal of the American Statistical Association, 82(398):387–394, 1987. doi: 10.1080/01621459.1987.10478441.DOI
- [12]Carl-Erik Särndal, Bengt Swensson, and Jan Wretman. Model Assisted Survey Sampling. Springer, New York, 1992. ISBN 9780387975283.
- [13]Henry Scheffé. Practical solutions of the Behrens–Fisher problem. Journal of the American Statistical Association, 65(332):1501–1508, 1970. doi: 10.1080/01621459.1970.10481179.DOI
- [14]Mervyn J. Silvapulle and Pranab Kumar Sen. Constrained Statistical Inference: Order, Inequality, and Shape Constraints. Wiley, Hoboken, NJ, 2005. ISBN 9780471208273.
- [15]Anastasios A. Tsiatis. Semiparametric Theory and Missing Data. Springer Series in Statistics. Springer, New York, 2006. ISBN 9780387324487.
- [16]Ting Ye, Jun Shao, Yanyao Yi, and Qingyuan Zhao. Toward better practice of covariate adjustment in analyzing randomized clinical trials. Journal of the American Statistical Association, 2022. doi: 10.1080/01621459.2022.2049278.DOI
- [17]Ting Ye, Marlena Bannick, Yanyao Yi, and Jun Shao. Robust variance estimation for covariate-adjusted unconditional treatment effect in randomized clinical trials with binary outcomes. Statistical Theory and Related Fields, 7(2):159–163, 2023. doi: 10.1080/24754269.2023.2205802.DOI