data table; input degree belief count @@; datalines; 1 1 9 1 2 8 1 3 27 1 4 8 1 5 47 1 6 236 2 1 23 2 2 39 2 3 88 2 4 49 2 5 179 2 6 706 3 1 28 3 2 48 3 3 89 3 4 19 3 5 104 3 6 293 ; proc format; value dc 1 = 'less than high school' 2 = 'high school or junior college' 3 = 'bachelors or graduate'; value bc 1 = 'dont believe' 2 = 'no way to find out' 3 = 'some higher power' 4 = 'believe sometimes' 5 = 'believe but doubts' 6 = 'know God exists'; run; proc freq data=table order=data; weight count; format degree dc. belief bc.; tables degree*belief / chisq expected norow nocol; run;