options ls=80; /* Problem 11.21 Freund 8th edition */ data one; do row=1 to 2; do column=1 to 3; input wt @@; output; end; end; cards; 32 69 19 168 231 81 ; proc freq data=one; weight wt; tables row*column/chisq; title 'Problem 11.21 Freund 8th edition'; /* Problem 11.27 Freund 8th edition */ data two; do row=1 to 3; do column=1 to 3; input wt @@; output; end; end; cards; 41 49 42 27 50 33 12 21 25 ; proc freq data=two; weight wt; tables row*column/chisq; title 'Problem 11.21 Freund 8th edition'; /* Example 8.13 page 394 R. L. Ott*/ data three; do row=1 to 3; do column=1 to 3; input wt @@; output; end; end; cards; 30 15 15 40 50 10 10 25 5 ; proc freq data=three; weight wt; tables row*column/chisq; title 'Example 8.13 page 394 R. L. Ott'; /* Example 8.15 from 403 R. L. Ott*/ data three; do row=1 to 3; do column=1 to 3; input wt @@; output; end; end; cards; 75 98 75 182 211 123 116 122 41 ; proc freq data=three; weight wt; tables row*column/chisq; title 'Example 8.15 403 R. L. Ott'; /* Example 8.17 page 409 R. L. Ott*/ data four; do level=1 to 3; do row=1 to 2; do column=1 to 2; input wt @@; output; end; end; end; cards; 40 10 15 35 35 15 20 30 43 7 31 19 ; proc freq data=four; weight wt; tables level*row*column/cmh; title ' Example 8.17 page 409 R. L. Ott'; /* cmh option is asking for Cochran-Mental-Haenszel statistic. Most people just call it Mental-Haenszel statistic. */