Example of Mantel-Haenzel strata test - YOURNAME 1 The data as SAS sees it: 23:35 Monday, September 19, 2005 Obs row f1 f2 m1 m2 sex col num 1 New 80 20 120 180 Female Improved 80 2 New 80 20 120 180 Female NotImproved 20 3 New 80 20 120 180 Male Improved 120 4 New 80 20 120 180 Male NotImproved 180 5 Standard 210 90 30 70 Female Improved 210 6 Standard 210 90 30 70 Female NotImproved 90 7 Standard 210 90 30 70 Male Improved 30 8 Standard 210 90 30 70 Male NotImproved 70 Example of Mantel-Haenzel strata test - YOURNAME 2 Chi-square tests for two 2x2 tables: 23:35 Monday, September 19, 2005 Note the signs of the two phi values. The FREQ Procedure Table 1 of row by col Controlling for sex=Female row col Frequency| Percent | Row Pct | Col Pct |Improved|NotImpro| Total | |ved | ---------+--------+--------+ New | 80 | 20 | 100 | 20.00 | 5.00 | 25.00 | 80.00 | 20.00 | | 27.59 | 18.18 | ---------+--------+--------+ Standard | 210 | 90 | 300 | 52.50 | 22.50 | 75.00 | 70.00 | 30.00 | | 72.41 | 81.82 | ---------+--------+--------+ Total 290 110 400 72.50 27.50 100.00 Statistics for Table 1 of row by col Controlling for sex=Female Statistic DF Value Prob ------------------------------------------------------ Chi-Square 1 3.7618 0.0524 Likelihood Ratio Chi-Square 1 3.9360 0.0473 Continuity Adj. Chi-Square 1 3.2769 0.0703 Mantel-Haenszel Chi-Square 1 3.7524 0.0527 Phi Coefficient 0.0970 Contingency Coefficient 0.0965 Cramer's V 0.0970 Fisher's Exact Test ---------------------------------- Cell (1,1) Frequency (F) 80 Left-sided Pr <= F 0.9825 Right-sided Pr >= F 0.0331 Table Probability (P) 0.0156 Two-sided Pr <= P 0.0536 Sample Size = 400 Example of Mantel-Haenzel strata test - YOURNAME 3 Chi-square tests for two 2x2 tables: 23:35 Monday, September 19, 2005 Note the signs of the two phi values. The FREQ Procedure Table 2 of row by col Controlling for sex=Male row col Frequency| Percent | Row Pct | Col Pct |Improved|NotImpro| Total | |ved | ---------+--------+--------+ New | 120 | 180 | 300 | 30.00 | 45.00 | 75.00 | 40.00 | 60.00 | | 80.00 | 72.00 | ---------+--------+--------+ Standard | 30 | 70 | 100 | 7.50 | 17.50 | 25.00 | 30.00 | 70.00 | | 20.00 | 28.00 | ---------+--------+--------+ Total 150 250 400 37.50 62.50 100.00 Statistics for Table 2 of row by col Controlling for sex=Male Statistic DF Value Prob ------------------------------------------------------ Chi-Square 1 3.2000 0.0736 Likelihood Ratio Chi-Square 1 3.2707 0.0705 Continuity Adj. Chi-Square 1 2.7876 0.0950 Mantel-Haenszel Chi-Square 1 3.1920 0.0740 Phi Coefficient 0.0894 Contingency Coefficient 0.0891 Cramer's V 0.0894 Fisher's Exact Test ---------------------------------- Cell (1,1) Frequency (F) 120 Left-sided Pr <= F 0.9729 Right-sided Pr >= F 0.0464 Table Probability (P) 0.0193 Two-sided Pr <= P 0.0753 Sample Size = 400 Example of Mantel-Haenzel strata test - YOURNAME 4 THE COMBINED TABLE - Chi-square test 23:35 Monday, September 19, 2005 Note the difference in sign in the phi value. THIS SHOWS SIMPSON'S PARADOX The FREQ Procedure Table of row by col row col Frequency| Percent | Row Pct | Col Pct |Improved|NotImpro| Total | |ved | ---------+--------+--------+ New | 200 | 200 | 400 | 25.00 | 25.00 | 50.00 | 50.00 | 50.00 | | 45.45 | 55.56 | ---------+--------+--------+ Standard | 240 | 160 | 400 | 30.00 | 20.00 | 50.00 | 60.00 | 40.00 | | 54.55 | 44.44 | ---------+--------+--------+ Total 440 360 800 55.00 45.00 100.00 Statistics for Table of row by col Statistic DF Value Prob ------------------------------------------------------ Chi-Square 1 8.0808 0.0045 Likelihood Ratio Chi-Square 1 8.0950 0.0044 Continuity Adj. Chi-Square 1 7.6818 0.0056 Mantel-Haenszel Chi-Square 1 8.0707 0.0045 Phi Coefficient -0.1005 Contingency Coefficient 0.1000 Cramer's V -0.1005 Fisher's Exact Test ---------------------------------- Cell (1,1) Frequency (F) 200 Left-sided Pr <= F 0.0028 Right-sided Pr >= F 0.9982 Table Probability (P) 9.997E-04 Two-sided Pr <= P 0.0055 Sample Size = 800 Example of Mantel-Haenzel strata test - YOURNAME 5 (Cochran-)Mantel-Haenszel test for 2 tables Note that the BRESLOW-DAY test is NOT SIGNIFICANT 23:35 Monday, September 19, 2005 The FREQ Procedure Summary Statistics for row by col Controlling for sex Cochran-Mantel-Haenszel Statistics (Based on Table Scores) Statistic Alternative Hypothesis DF Value Prob --------------------------------------------------------------- 1 Nonzero Correlation 1 6.8991 0.0086 2 Row Mean Scores Differ 1 6.8991 0.0086 3 General Association 1 6.8991 0.0086 Estimates of the Common Relative Risk (Row1/Row2) Type of Study Method Value 95% Confidence Limits ------------------------------------------------------------------------- Case-Control Mantel-Haenszel 1.6250 1.1297 2.3376 (Odds Ratio) Logit 1.6235 1.1283 2.3359 Cohort Mantel-Haenszel 1.2000 1.0496 1.3719 (Col1 Risk) Logit 1.1645 1.0379 1.3066 Cohort Mantel-Haenszel 0.8000 0.6790 0.9426 (Col2 Risk) Logit 0.8317 0.7170 0.9647 Breslow-Day Test for Homogeneity of the Odds Ratios ------------------------------ Chi-Square 0.0675 DF 1 Pr > ChiSq 0.7950 Total Sample Size = 800 Example of Mantel-Haenzel strata test - YOURNAME 6 A SECOND EXAMPLE WITH 3 2x2 TABLES: 23:35 Monday, September 19, 2005 The data as SAS sees it (9 variables were dropped): Obs row age col num 1 Treated Young Sick 99 2 Treated Young Well 190 3 Treated Middle Sick 41 4 Treated Middle Well 159 5 Treated Old Sick 40 6 Treated Old Well 42 7 Control Young Sick 306 8 Control Young Well 381 9 Control Middle Sick 193 10 Control Middle Well 618 11 Control Old Sick 108 12 Control Old Well 107 Example of Mantel-Haenzel strata test - YOURNAME 7 A SECOND EXAMPLE WITH 3 2x2 TABLES: 23:35 Monday, September 19, 2005 Within-strata tests for 3 tables AND the (Cochran-)Mantel Haenszel test The FREQ Procedure Table 1 of row by col Controlling for age=Young row col Frequency| Percent | Row Pct | Col Pct |Sick |Well | Total ---------+--------+--------+ Treated | 99 | 190 | 289 | 10.14 | 19.47 | 29.61 | 34.26 | 65.74 | | 24.44 | 33.27 | ---------+--------+--------+ Control | 306 | 381 | 687 | 31.35 | 39.04 | 70.39 | 44.54 | 55.46 | | 75.56 | 66.73 | ---------+--------+--------+ Total 405 571 976 41.50 58.50 100.00 Statistics for Table 1 of row by col Controlling for age=Young Statistic DF Value Prob ------------------------------------------------------ Chi-Square 1 8.8646 0.0029 Likelihood Ratio Chi-Square 1 8.9801 0.0027 Continuity Adj. Chi-Square 1 8.4460 0.0037 Mantel-Haenszel Chi-Square 1 8.8555 0.0029 Phi Coefficient -0.0953 Contingency Coefficient 0.0949 Cramer's V -0.0953 Fisher's Exact Test ---------------------------------- Cell (1,1) Frequency (F) 99 Left-sided Pr <= F 0.0017 Right-sided Pr >= F 0.9989 Table Probability (P) 6.549E-04 Two-sided Pr <= P 0.0035 Sample Size = 976 Example of Mantel-Haenzel strata test - YOURNAME 8 A SECOND EXAMPLE WITH 3 2x2 TABLES: 23:35 Monday, September 19, 2005 Within-strata tests for 3 tables AND the (Cochran-)Mantel Haenszel test The FREQ Procedure Table 2 of row by col Controlling for age=Middle row col Frequency| Percent | Row Pct | Col Pct |Sick |Well | Total ---------+--------+--------+ Treated | 41 | 159 | 200 | 4.06 | 15.73 | 19.78 | 20.50 | 79.50 | | 17.52 | 20.46 | ---------+--------+--------+ Control | 193 | 618 | 811 | 19.09 | 61.13 | 80.22 | 23.80 | 76.20 | | 82.48 | 79.54 | ---------+--------+--------+ Total 234 777 1011 23.15 76.85 100.00 Statistics for Table 2 of row by col Controlling for age=Middle Statistic DF Value Prob ------------------------------------------------------ Chi-Square 1 0.9809 0.3220 Likelihood Ratio Chi-Square 1 1.0020 0.3168 Continuity Adj. Chi-Square 1 0.8042 0.3698 Mantel-Haenszel Chi-Square 1 0.9799 0.3222 Phi Coefficient -0.0311 Contingency Coefficient 0.0311 Cramer's V -0.0311 Fisher's Exact Test ---------------------------------- Cell (1,1) Frequency (F) 41 Left-sided Pr <= F 0.1854 Right-sided Pr >= F 0.8613 Table Probability (P) 0.0467 Two-sided Pr <= P 0.3500 Sample Size = 1011 Example of Mantel-Haenzel strata test - YOURNAME 9 A SECOND EXAMPLE WITH 3 2x2 TABLES: 23:35 Monday, September 19, 2005 Within-strata tests for 3 tables AND the (Cochran-)Mantel Haenszel test The FREQ Procedure Table 3 of row by col Controlling for age=Old row col Frequency| Percent | Row Pct | Col Pct |Sick |Well | Total ---------+--------+--------+ Treated | 40 | 42 | 82 | 13.47 | 14.14 | 27.61 | 48.78 | 51.22 | | 27.03 | 28.19 | ---------+--------+--------+ Control | 108 | 107 | 215 | 36.36 | 36.03 | 72.39 | 50.23 | 49.77 | | 72.97 | 71.81 | ---------+--------+--------+ Total 148 149 297 49.83 50.17 100.00 Statistics for Table 3 of row by col Controlling for age=Old Statistic DF Value Prob ------------------------------------------------------ Chi-Square 1 0.0501 0.8229 Likelihood Ratio Chi-Square 1 0.0501 0.8229 Continuity Adj. Chi-Square 1 0.0088 0.9251 Mantel-Haenszel Chi-Square 1 0.0499 0.8232 Phi Coefficient -0.0130 Contingency Coefficient 0.0130 Cramer's V -0.0130 Fisher's Exact Test ---------------------------------- Cell (1,1) Frequency (F) 40 Left-sided Pr <= F 0.4626 Right-sided Pr >= F 0.6381 Table Probability (P) 0.1007 Two-sided Pr <= P 0.8969 Sample Size = 297 Example of Mantel-Haenzel strata test - YOURNAME 10 A SECOND EXAMPLE WITH 3 2x2 TABLES: 23:35 Monday, September 19, 2005 Within-strata tests for 3 tables AND the (Cochran-)Mantel Haenszel test The FREQ Procedure Summary Statistics for row by col Controlling for age Cochran-Mantel-Haenszel Statistics (Based on Table Scores) Statistic Alternative Hypothesis DF Value Prob --------------------------------------------------------------- 1 Nonzero Correlation 1 7.8919 0.0050 2 Row Mean Scores Differ 1 7.8919 0.0050 3 General Association 1 7.8919 0.0050 Estimates of the Common Relative Risk (Row1/Row2) Type of Study Method Value 95% Confidence Limits ------------------------------------------------------------------------- Case-Control Mantel-Haenszel 0.7426 0.6030 0.9145 (Odds Ratio) Logit 0.7428 0.6032 0.9148 Cohort Mantel-Haenszel 0.8293 0.7252 0.9483 (Col1 Risk) Logit 0.8361 0.7323 0.9546 Cohort Mantel-Haenszel 1.1023 1.0327 1.1767 (Col2 Risk) Logit 1.0884 1.0229 1.1582 Breslow-Day Test for Homogeneity of the Odds Ratios ------------------------------ Chi-Square 2.0120 DF 2 Pr > ChiSq 0.3657 Total Sample Size = 2284 Example of Mantel-Haenzel strata test - YOURNAME 11 A SECOND EXAMPLE WITH 3 2x2 TABLES: 23:35 Monday, September 19, 2005 The INCORRECT combined table. The FREQ Procedure Table of row by col row col Frequency| Percent | Row Pct | Col Pct |Sick |Well | Total ---------+--------+--------+ Treated | 180 | 391 | 571 | 7.88 | 17.12 | 25.00 | 31.52 | 68.48 | | 22.87 | 26.12 | ---------+--------+--------+ Control | 607 | 1106 | 1713 | 26.58 | 48.42 | 75.00 | 35.43 | 64.57 | | 77.13 | 73.88 | ---------+--------+--------+ Total 787 1497 2284 34.46 65.54 100.00 Statistics for Table of row by col Statistic DF Value Prob ------------------------------------------------------ Chi-Square 1 2.9009 0.0885 Likelihood Ratio Chi-Square 1 2.9290 0.0870 Continuity Adj. Chi-Square 1 2.7303 0.0985 Mantel-Haenszel Chi-Square 1 2.8996 0.0886 Phi Coefficient -0.0356 Contingency Coefficient 0.0356 Cramer's V -0.0356 Fisher's Exact Test ---------------------------------- Cell (1,1) Frequency (F) 180 Left-sided Pr <= F 0.0487 Right-sided Pr >= F 0.9608 Table Probability (P) 0.0095 Two-sided Pr <= P 0.0934 Sample Size = 2284 Example of Mantel-Haenzel strata test - YOURNAME 12 A SECOND EXAMPLE WITH 3 2x2 TABLES: 23:35 Monday, September 19, 2005 USING SAS ARRAYS in the data step: The data as SAS sees it This should be exactly the same as before. Obs row age col num 1 Treated Young Sick 99 2 Treated Young Well 190 3 Treated Middle Sick 41 4 Treated Middle Well 159 5 Treated Old Sick 40 6 Treated Old Well 42 7 Control Young Sick 306 8 Control Young Well 381 9 Control Middle Sick 193 10 Control Middle Well 618 11 Control Old Sick 108 12 Control Old Well 107