/*fitting an incomplete table */ /*replace a missing value with any value, e.g. 0*/ /*create a numerical indicator variable 'delta' that takes 1 for the missing value and zero everywhere else */ options ls=90 nocenter nodate; data concerns; input age $ gender $ health $ count delta1 delta2; datalines; 1 male sex 4 0 0 1 male mens 0 1 0 1 male healthy 42 0 0 1 male none 57 0 0 1 female sex 9 0 0 1 female mens 4 0 0 1 female healthy 19 0 0 1 female none 71 0 0 2 male sex 2 0 0 2 male mens 0 0 1 2 male healthy 7 0 0 2 male none 20 0 0 2 female sex 7 0 0 2 female mens 8 0 0 2 female healthy 10 0 0 2 female none 31 0 0 ; /*without an indicator variable*/ proc genmod data=concerns order=data; class age gender health; model count = age gender health age*health age*gender gender*health age*gender*health/link=log dist=poisson lrci type3 obstats; title 'Saturated model without indicator'; /*with indicator variable */ proc genmod data=concerns order=data; class age gender health; model count = age gender health age*health age*gender gender*health age*gender*health delta1 delta2/link=log dist=poisson lrci type3 obstats; title 'Saturated Model'; run; /*without and indicator variable*/ proc genmod data=concerns order=data; class age gender health; model count = age gender health age*health age*gender gender*health/link=log dist=poisson lrci type3 obstats; title 'Homog. model without indicator'; /*with indicator variable */ proc genmod data=concerns order=data; class age gender health; model count = age gender health age*health age*gender gender*health delta1 delta2/link=log dist=poisson lrci type3 obstats; title 'Homog. Model'; run; /*without and indicator variable*/ proc genmod data=concerns order=data; class age gender health; model count = age gender health /link=log dist=poisson lrci type3 obstats; title 'Indepedence model'; run; /*with and indicator variable*/ proc genmod data=concerns order=data; class age gender health; model count = age gender health delta1 delta2/link=log dist=poisson lrci type3 obstats; title 'Indepedence model'; run; ;