/*------------ job security and happiness from general social survey ------------*/ options ls=80 nocenter; data gss; input jobsecok $ x happy $ y count; datalines; Notatall 1 Nottoo 1 15 Nottoo 2 Nottoo 1 21 Somewhat 3 Nottoo 1 64 Very 4 Nottoo 1 73 Notatall 1 Pretty 2 25 Nottoo 2 Pretty 2 47 Somewhat 3 Pretty 2 248 Very 4 Pretty 2 474 Notatall 1 Very 3 5 Nottoo 2 Very 3 21 Somewhat 3 Very 3 100 Very 4 Very 3 311 ; proc freq data=gss; weight count; tables jobsecok*happy/chm1 scores=ridits; title 'CHM statstic for linear association'; run; proc genmod data=gss order=data; class jobsecok happy; model count=jobsecok happy/link=log dist=poisson lrci type3 obstats; title 'Indepedence Model'; run; proc genmod data=gss order=data; class jobsecok happy; model count=jobsecok happy x*y/link=log dist=poisson lrci type3 obstats; title 'Linear by Linear Association Model'; run;