data affdis; input outcome diag count; label outcome='occupational outcome' diagnosis='affective disorder diagnosis'; lines; 1 1 65 1 2 58 1 3 142 2 1 14 2 2 7 2 3 33 3 1 107 3 2 21 3 3 37 run; proc format; value outcome 1='good' 2='fair' 3='poor'; value diag 1='schiz' 2='mania' 3='depress'; proc freq; weight count; tables outcome*diag/norow nocol nopercent chisq; format outcome outcome. diag diag.; Title 'Example of chi-square test for homogeneity'; Title2 'Example 12.3.1.1 P. 449 of Woolson and Clarke'; run;