data a; input temp distress; datalines; 66 0 72 0 70 1 75 0 75 1 70 1 73 0 78 0 70 0 76 0 69 0 70 0 67 0 81 0 58 1 68 0 57 1 53 1 76 0 67 0 63 1 67 0 79 0 ; *Code for Class Exericse 6.2; proc logistic descending; model distress=temp/outroc=plotroc; run; symbol1 i=join v=none c=blue; proc gplot data=plotroc; title 'ROC Curve'; plot _sensit_*_1mspec_=1/vaxis=0 to 1 by .1; run; *Code for Class Exercise 6.6; proc genmod descending; model distress=temp/dist=binomial link=logit; output out=outlogit p=plogit stdreschi=splogit; run; proc genmod descending; model distress=temp/dist=binomial link=probit; output out=outprobit p=pprobit stdreschi=spprobit; run; proc genmod descending; model distress=temp/dist=binomial link=cll; output out=outcll p=pcll stdreschi=spcll; run; data c; merge outlogit outprobit outcll; label plogit="Logit" pprobit="Probit" pcll="Cloglog" splogit="Logit" spprobit="Probit" spcll="Cloglog"; symbol1 color=black interpol=none value=plus; symbol2 color=red interpol=none value=circle; symbol3 color=green interpol=none value=star; axis1 label=("Temperature"); axis2 label=("Failure Prob"); axis3 label=("Residual"); legend1 label=none; proc gplot data=c; title "Standardized residuals for Challenger Data"; plot (splogit spprobit spcll)*temp /overlay haxis=axis1 vaxis=axis3 legend=legend1; run; title "Predicted O-Ring Failure Probability"; plot (plogit pprobit pcll)*temp/overlay haxis=axis1 vaxis=axis2 legend=legend1; run;