CMH Example

Example

Example 1: A study was conducted to see whether there was a difference in the rate of lung cancer between people who smoked one pack of cigarettes a day and those that regularly smoked an electronic cigarette. In the study, the confounding effect of the pollution level in the city where the smoker resided was taken into account. The results of the study are shown in Figure 2.

CMH cancer study example

Figure 1 – Data for cancer study

To perform the analysis using the formulas described in CMH Test Basic Concepts, we first reformat the data as shown on the left side of Figure 2.

CMH analysis

Figure 2 – CMH analysis

Here k = 3 (corresponding to the values Low, Medium and High for the confounding factor of Pollution) and the values in each row in the range B4:E6 correspond to the values ai, bi, ci, di and ni in Figure 1 of CMH Test Basic Concepts. The corresponding eand si values are shown in range H4:H6. E.g. cell H4 contains the value of e1 (for the Low pollution level) as calculated by the formula =(B4+C4)*(B4+D4)/F4. Similarly, cell I4 contains the formula =(B4+C4)*(B4+D4)*(C4+E4)*(D4+E4)/(F4^2*(F4-1)), used to calculate the value of s1.  The values in range B7:I7 contain sums (e.g. cell H7 contains the formula =SUM(H4:H6).

CMH test

The value of the CMH statistic M is 4.62 (cell I9) as calculated by the formula =(ABS(B7-H7)-0.5)^2/I7. The corresponding p-value (cell I10) of .0316 is calculated by =CHISQ.DIST.RT(I9,1). Similarly, the M statistic and p-value without the Yates correction are shown in range L9:L10.

Since p-value = .031589 < .05 = α, we conclude that the odds ratios are not all equal to one.

Odds ratio

We can calculate the odds ratios for each of the three contingency tables, as shown in range M4:M6. E.g. the odds ratio for the Low pollution case is 1.948 (cell M4). The common odds ratio is 1.589 is shown in cell M7 as calculated by K7/L7.

Figure 3 shows how to calculate the 95% confidence interval for the common odds ratio.

Confidence interval of r

Figure 3 – 95% confidence interval for common odds ratio

E.g. cell H15 contains the formula =(B4+E4)/F4, K15 contains the formula =C4*D4/F4, M15 contains the formula =H15*K15 and M18 contains the formula =SUM(M15:M17). Cell I20 contains the formula =SQRT((L18/J18^2+O18/K18^2+(M18+N18)/(J18*K18))/2) and L20 contains the formula =M7.

Finally, the ends of the 95% confidence interval for the common odds ratio are contained in cells L22 and L23. The lower end (cell L22) is calculated by the formula =EXP(LN(L20)-NORM.S.INV(1-L21/2)*I20) and the upper end (cell L23) by the formula =EXP(LN(L20)+NORM.S.INV(1-L21/2)*I20).

Since r = 1 is outside the interval (1.059, 2.382), we conclude that the odds ratios are not all equal to one.

Woolf’s Heterogeneity test

We now show how to perform the Woolf’s Heterogeneity Test (see Figure 4).

Woolf's heterogeneity test

Figure 4 – Heterogeneity Test

Here, the odds ratios in range H28:H30 are copied from M4:M6 in Figure 2. The formula =EXP(SUMPRODUCT(I28:I30,LN(H28:H30))/I31) is used to calculate the alternative common odds ratio in cell H31. The value of p (cell I31) is calculated by =SUM(I28:I30) where p1 (in cell I28) is calculated by the formula =1/SUMPRODUCT(1/B4:E4).

Finally, the W statistic in cell L28 is calculated by the formula =SUMPRODUCT(I28:I30,(LN(H28:H30)-LN(H31))^2), df in cell L29 by =COUNTA(A4:A6)-1 and the p-value in L30 by =CHISQ.DIST.RT(L28,L29).

Since p-value = .696 > .05 = α, we accept the null hypothesis that the odds ratios are equal (although not necessarily equal to one).

Examples Workbook

Click here to download the Excel workbook with the examples described on this webpage.

References

PennState (2017) Cochran-Mantel-Haenszel test
https://online.stat.psu.edu/stat504/lesson/5/5.3/5.3.5

SAS Help Center (2019) Cochran-Mantel-Haenszel statistics
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_freq_details92.htm

Moral de la Rubia, J., Valle de la O, A. (2023) Everything you wanted to know but could never find from the Cochran-Mantel-Haenszel test
https://www.scirp.org/pdf/jdaip_2023082810224634.pdf

Leave a Comment