data smoke; input agegrp sex smoke count; cards; 1 1 1 12 1 1 2 18 1 2 1 5 1 2 2 15 2 1 1 40 2 1 2 10 2 2 1 25 2 2 2 50 ; proc freq; tables agegrp *sex*smoke / chisq cmh relrisk; weight count; run;