data followupdis; input outcome diag count; label outcome='follow-up outcome' diagnosis='affective disorder diagnosis'; lines; 1 1 56 1 2 5 1 3 16 2 1 37 2 2 20 2 3 18 run; proc format; value outcome 1='same' 2='not same'; 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.2.2.1 P. 445 of Woolson and Clarke'; run;