data cmh; input hospital driving hernia count @@; cards; 1 1 1 8 1 1 2 1 1 2 1 47 1 2 2 26 2 1 1 5 2 1 2 0 2 2 1 17 2 2 2 21 3 1 1 4 3 1 2 4 3 2 1 13 3 2 2 77 4 1 1 2 4 1 2 10 4 2 1 12 4 2 2 65 5 1 1 1 5 1 2 3 5 2 1 5 5 2 2 10 6 1 1 1 6 1 2 2 6 2 1 3 6 2 2 11 7 1 1 2 7 1 2 2 7 2 1 12 7 2 2 37 ; title 'Data from pp. 201-202 of Fisher and van Belle'; run; /*The Mantel-Haenszel odds ratio and the Breslow-Day statistic*/ proc freq data=cmh; weight count; table hospital*driving*hernia/ cmh norow nocol nopercent relrisk; ods output RelativeRisks=temp; run; proc print data=temp (rename= (value=oddsratio) ) noobs; where StudyType='Case-Control (Odds Ratio)'; var table oddsratio; title 'Odds Ratio by hospital'; run;