Mantel-Haenszel Test/Comparison
using SAS (PROC FREQ)
(Pooling results from several 2x2 tables)
See www.stattutorials.com/SASDATA for files mentioned in this tutorial, © TexaSoft, 2007-10
These SAS statistics tutorials briefly explain the use and interpretation of standard statistical analysis techniques for Medical, Pharmaceutical, Clinical Trials, Marketing or Scientific Research. The examples include how-to instructions for SAS Software.
The Mantel-Haenszel method is often used particularly in meta-analysis) to pool the results from several 2 x 2 contingency tables. It is also useful for the analysis of two dichotomous variables while adjusting for a third variable to determine whether there is a relationship between the two variables controlling for levels of the third variable.
Appropriate applications of the Mantel-Haenszel procedure
Disease incidence: Case-control data for a disease are collected in several cities, forming a 2 x 2 table for each city. You could use a Mantel-Haenszel analysis to obtain a pooled estimate of the odds ratio across cities.
Pooling results from previous studies: Several published studies have analyzed the same categorical variables summarized in 2 x 2 tables. In meta-analysis, the information from the studies is pooled in order to provide more definitive findings than could be obtained from a single study. Mantel-Haenszel analysis can be used to pool this type of information. For more on meta-analysis see Hunt (1997) and Lipsey (2000).
Hypotheses tests used in Mantel-Haenszel analysis
The hypotheses tested in the Mantel-Haenszel test are
Ho: There is no relationship between the two variables of interest when controlling for a third variable
Ha: There is a relationship between the two variables of interest when controlling for a third variable
Design considerations for Mantel-Haenszel test
A Mantel-Haenszel analysis looks at several 2 x 2 tables from the same bivariate variables, each representing some strata or group, (e.g. information from different departments at a university, etc.) or from different results of similar analyses (as in a meta analysis). The test also assumes that the tables are independent (subjects or entities are in one and only one table).
Example Mantel-Haenszel analysis of Berkeley graduate admission data
A classic data set illustrating the use of the Mantel-Haenszel test is data collected at the University of California at Berkeley concerning gender patterns in graduate admissions. (Bickel and O’Connell, 1975). The crosstabulated data for acceptance (no or yes) vs gender is given in Table 5.11 for five separate departments along with row percentages showing the percentage of each gender who were admitted within each program. From this table it can be seen that while Department 1 seems to have higher admission rates than the other departments, the comparative acceptance rates for males and females is about the same within departments with there being a slight tendency for females to be admitted at a higher rate.
The Mantel-Haenszel test can be used to test the hypotheses
Ho: Controlling for (or within departments) there is no relationship between gender and acceptance
Ha: Controlling for (or within departments) there is a relationship between gender and acceptance
Berkley Data
Department |
Gender |
Accepted |
Count |
1 |
1 |
0 |
8 |
1 |
1 |
1 |
17 |
1 |
2 |
0 |
207 |
1 |
2 |
1 |
353 |
2 |
1 |
0 |
391 |
2 |
1 |
1 |
202 |
2 |
2 |
0 |
205 |
2 |
2 |
1 |
120 |
3 |
1 |
0 |
244 |
3 |
1 |
1 |
131 |
3 |
2 |
0 |
279 |
3 |
2 |
1 |
138 |
4 |
1 |
0 |
299 |
4 |
1 |
1 |
94 |
4 |
2 |
0 |
138 |
4 |
2 |
1 |
53 |
5 |
1 |
0 |
317 |
5 |
1 |
1 |
24 |
5 |
2 |
0 |
351 |
5 |
2 |
1 |
22 |
DATA BIAS;
INPUT Department Gender Accepted Count;
DATALINES;
1 1 0 8
1 1 1 17
1 2 0 207
1 2 1 353
…etc…
5 2 1 22
;
ods html;
PROC FREQ DATA=BIAS;
WEIGHT COUNT;
TABLES DEPARTMENT*GENDER*ACCEPTED/CMH;
RUN;
ODS HTML CLOSE;
Results are given below:
Cochran-Mantel-Haenszel Statistics (Based on Table Scores) |
||||
Statistic |
Alternative Hypothesis |
DF |
Value |
Prob |
1 |
Nonzero Correlation |
1 |
0.1250 |
0.7237 |
2 |
Row Mean Scores Differ |
1 |
0.1250 |
0.7237 |
3 |
General Association |
1 |
0.1250 |
0.7237 |
Mantel-Haenszel results are shown where it can be seen that p = 0.724 indicating that controlling for departments, there is no reason to conclude that there is a difference between male vs. female admission rates. As mentioned previously, the consistent pattern is that the admission rates for males and females are about the same for each department with perhaps a slight tendency for females to have a higher rate of admission. Cochran’s test is similar to the Mantel-Haenszel test but is not commonly reported. In this example, Cochran’s test gives results consistent with the Mantel-Haenszel test.
Reporting Results of a Mantel-Haenszel Analysis
Narrative for the methods section:
“Controlling for department, the relationship between gender and acceptance is examined using a Mantel-Haenszel analysis.”
Narrative for the results section:
“Adjusting or controlling for department, no significant difference was found between male and female acceptance rates, Chi-Square (1, N=3593) = 0.125, p = 0.72.”
End of tutorial


