libname job '/home/grego1/STAT 770'; run; /* Treatment has been collapsed into a */ /* control category (treatment=0) and a treatment category (treatment=1) */ proc format; value cityfmt 1='Atlanta' 4='Grand Rapids' 7='Riverside'; value trtfmt 0='Control' 1='Job Training'; value yfmt 0='Unemployed' 1='Employed'; data a; set JOB.logistic; if job>0 and job<6 then employed=1; else employed=0; if treatment>1 then treatment=1; format city cityfmt. treatment trtfmt. employed yfmt.; run; proc sort data=a; by city; * We use cmh here to obtain odds ratios; proc freq data=a; by city; table treatment*employed/cmh; run; proc genmod descending; class treatment city; model employed=treatment city/dist=bin link=logit type3; run; /* Model with treatment as a covariate instead of a factor */ proc genmod descending; class city; model employed=treatment city/dist=bin link=logit type3; run; /* Model with treatment as a covariate instead of a factor; */ /* heterogenous odds ratio */ proc genmod descending; class city; model employed=treatment|city/dist=bin link=logit type3; proc freq; tables city*treatment*employed/chisq cmh; run;