This example plots an ROC curve, estimates a customized odds ratio, produces the traditional goodness-of-fit analysis, displays
the generalized R Square measures for the fitted model, calculates the normal confidence intervals for the regression parameters,
and produces a display of the probability function and prediction curves for the fitted model. The data consist of three variables:
n
(number of subjects in the sample), disease
(number of diseased subjects in the sample), and age
(age for the sample). A linear logistic regression model is used to study the effect of age on the probability of contracting
the disease. The statements to produce the data set and perform the analysis are as follows:
data Data1; input disease n age; datalines; 0 14 25 0 20 35 0 19 45 7 18 55 6 12 65 17 17 75 ;
ods graphics on; proc logistic data=Data1 plots(only)=roc(id=obs); model disease/n=age / scale=none clparm=wald clodds=pl rsquare; units age=10; effectplot; run; ods graphics off;
The option SCALE=NONE
is specified to produce the deviance and Pearson goodness-of-fit analysis without adjusting for overdispersion. The RSQUARE
option is specified to produce generalized R Square measures of the fitted model. The CLPARM=WALD
option is specified to produce the Wald confidence intervals for the regression parameters. The UNITS
statement is specified to produce customized odds ratio estimates for a change of 10 years in the age
variable, and the CLODDS=PL
option is specified to produce profile-likelihood confidence limits for the odds ratio. The PLOTS=
option with ODS Graphics enabled produces a graphical display of the ROC curve, and the EFFECTPLOT
statement displays the model fit.
The results in Output 60.7.1 show that the deviance and Pearson statistics indicate no lack of fit in the model.
Output 60.7.2 shows that the R-square for the model is 0.74. The odds of an event increases by a factor of 7.9 for each 10-year increase in age.
Because ODS Graphics is enabled, a graphical display of the ROC curve is produced as shown in Output 60.7.3.
Note that the area under the ROC curve is estimated by the statistic c in the "Association of Predicted Probabilities and Observed Responses" table. In this example, the area under the ROC curve is 0.953.
Because there is only one continuous covariate and because ODS Graphics is enabled, the EFFECTPLOT statement produces a graphical display of the predicted probability curve with bounding 95% confidence limits as shown in Output 60.7.4.