/* chex99.sas */ /* Example 9.9 -- Frome Poisson regression problem */ /* Lung cancer death rates by age group and */ /* smoking rate groups */ /* See E.L. Frome (1983) Biometrics, pp.665-674 */ /* */ /* i = 1,...,9=ni age group */ /* j = 1,...,7=nj smoking rate group (nonsmokers are j=1*/ /* nij = number in each i,j category */ /* yij = number of deaths in category */ /* */ options ls=80 ; data a ; infile '~/www/aug00/chap9/frome.dat' ; input i j nij yij ; /* set up dummies for age group */ age1 = ( i = 1 ) ; age2 = ( i = 2 ) ; age3 = ( i = 3 ) ; age4 = ( i = 4 ) ; age5 = ( i = 5 ) ; age6 = ( i = 6 ) ; age7 = ( i = 7 ) ; age8 = ( i = 8 ) ; age9 = ( i = 9 ) ; /* set up dummies for smoking group */ smoke2 = ( j = 2 ) ; smoke3 = ( j = 3 ) ; smoke4 = ( j = 4 ) ; smoke5 = ( j = 5 ) ; smoke6 = ( j = 6 ) ; smoke7 = ( j = 7 ) ; lognij = log( nij ) ; ; run ; /* */ /* write out the data */ proc print data=a ; title 'Example 9.9 -- Frome Poisson regression problem' ; run ; /* */ /* yij is Poisson( lambdaij ) */ /* lambdaij = nij*exp( alpha(i) + delta(j) ) */ /* or = exp( lognij + alpha(i) + delta(j) ) */ /* with delta(1) = 0 (no smoke1, no intercept) */ proc genmod data=a ; model yij = age1-age9 smoke2-smoke7 / dist=poisson link=log noint offset=lognij ; run ;