options formdlim = '-'; data vitc; input trt $ cold $ n; cards; Placebo Yes 335 Placebo No 76 Vit.C Yes 302 Vit.C No 105 ; proc freq; table trt*cold / norow nocol nopercent chisq measures cl; weight n; title 'Chi-square test'; /* Here's how to do a chi-square test when each observation is one case */ /* this is made up data */ /* A has 2 levels, B has 3 */ data madeup; input a b; cards; 1 1 0 1 1 2 1 1 0 1 0 2 0 2 0 1 1 0 1 0 0 0 0 0 0 0 ; proc freq; table a*b /norow nocol nopercent chisq ; title 'Chi-square test, starting with individual obs.'; run;