* Homework 4, problem 1 Data from Agresti (2007) on infant malformation due to alchol consumption. ; data quasi; input drink $ score absent present ; ncases = absent+present; p=present/ncases; label drink='Alcohol consumption' score ='Scores for alcohol consumption' absent='Malformation absent' present='Malformation present' ncases='# of cases with same alcohol consumption'; cards; 0 0 17066 48 <1 .5 14464 38 1-2 1.5 788 5 3-5 4 126 1 >=6 7 37 1 ; title 'Linear probability model for infant malformation data'; proc genmod data=quasi order=data; model present/ncases = score /link=indentity dist=binomial obstats residuals; output out=linout pred=linpred upper=linup lower=linlo ; run; title 'Probit model for infant malformation data'; proc genmod data=quasi order=data; model present/ncases = score /link=probit dist=binomial obstats residuals; output out=probout pred=probfit upper=probup lower=probup; title 'Logit model for infant malformation data'; proc genmod data=quasi order=data; model present/ncases = score /link=logit dist=binomial obstats residuals; output out=logout pred=logfit upper=logup lower=loglo; data allmodel; merge logout probout linout; run; goptions reset=(axis, legend, pattern, symbol, title, footnote) norotate hpos=0 vpos=0 htext=2.0 ftext=swiss ctext= target= gaccess= gsfmode=; goptions device=win ; axis2 label=(angle=90 'Proportion/Probability') order=0 to .03 by .005; axis1 label=('Alcohol Consumption') order=0 to 8 by 2; symbol1 color=black interpol=none value=dot; symbol2 color=blue interpol=spline value=square; symbol3 color=red interpol=spline value=circle; symbol4 color=green interpol=spline value=star; legend1 position=(top center outside) label=none value=('Observed' 'linear' 'logit' 'probit') frame cshadow=pink; proc gplot data=allmodel; plot p*score=1 linpred*score=2 logfit*score=4 probfit*score=3 / overlay frame haxis=axis1 vaxis=axis2 legend=legend1; title 'Infant Malformation Data'; run;