The LOGISTIC Procedure

Example 73.6 Logistic Regression Diagnostics

(View the complete code for this example.)

In a controlled experiment to study the effect of the rate and volume of air intake on a transient reflex vasoconstriction in the skin of the digits, 39 tests under various combinations of rate and volume of air intake were obtained (Finney 1947). The endpoint of each test is whether or not vasoconstriction occurred. Pregibon (1981) uses this set of data to illustrate the diagnostic measures he proposes for detecting influential observations and to quantify their effects on various aspects of the maximum likelihood fit.

The vasoconstriction data are saved in the data set vaso:

data vaso;
   length Response $12;
   input Volume Rate Response @@;
   LogVolume=log(Volume);
   LogRate=log(Rate);
   datalines;
3.70  0.825  constrict       3.50  1.09   constrict
1.25  2.50   constrict       0.75  1.50   constrict
0.80  3.20   constrict       0.70  3.50   constrict
0.60  0.75   no_constrict    1.10  1.70   no_constrict
0.90  0.75   no_constrict    0.90  0.45   no_constrict
0.80  0.57   no_constrict    0.55  2.75   no_constrict
0.60  3.00   no_constrict    1.40  2.33   constrict
0.75  3.75   constrict       2.30  1.64   constrict
3.20  1.60   constrict       0.85  1.415  constrict
1.70  1.06   no_constrict    1.80  1.80   constrict
0.40  2.00   no_constrict    0.95  1.36   no_constrict
1.35  1.35   no_constrict    1.50  1.36   no_constrict
1.60  1.78   constrict       0.60  1.50   no_constrict
1.80  1.50   constrict       0.95  1.90   no_constrict
1.90  0.95   constrict       1.60  0.40   no_constrict
2.70  0.75   constrict       2.35  0.03   no_constrict
1.10  1.83   no_constrict    1.10  2.20   constrict
1.20  2.00   constrict       0.80  3.33   constrict
0.95  1.90   no_constrict    0.75  1.90   no_constrict
1.30  1.625  constrict
;

In the data set vaso, the variable Response represents the outcome of a test. The variable LogVolume represents the log of the volume of air intake, and the variable LogRate represents the log of the rate of air intake.

The following statements invoke PROC LOGISTIC to fit a logistic regression model to the vasoconstriction data, where Response is the response variable, and LogRate and LogVolume are the explanatory variables. Regression diagnostics are displayed when ODS Graphics is enabled, and the INFLUENCE option is specified to display a table of the regression diagnostics.

ods graphics on;
title 'Occurrence of Vasoconstriction';
proc logistic data=vaso;
   model Response=LogRate LogVolume/influence;
run;

Results of the model fit are shown in Output 73.6.1. Both LogRate and LogVolume are statistically significant to the occurrence of vasoconstriction (p = 0.0131 and p = 0.0055, respectively). Their positive parameter estimates indicate that a higher inspiration rate or a larger volume of air intake is likely to increase the probability of vasoconstriction.

Output 73.6.1: Logistic Regression Analysis for Vasoconstriction Data

Occurrence of Vasoconstriction

The LOGISTIC Procedure

Model Information
Data SetWORK.VASO
Response VariableResponse
Number of Response Levels2
Modelbinary logit
Optimization TechniqueFisher's scoring

Number of Observations Read39
Number of Observations Used39

Response Profile
Ordered
Value
ResponseTotal
Frequency
1constrict20
2no_constrict19

Probability modeled is Response='constrict'.


Model Convergence Status
Convergence criterion (GCONV=1E-8) satisfied.

Model Fit Statistics
CriterionIntercept OnlyIntercept and
Covariates
AIC56.04035.227
SC57.70340.218
-2 Log L54.04029.227

Testing Global Null Hypothesis: BETA=0
TestChi-SquareDFPr > ChiSq
Likelihood Ratio24.81252<.0001
Score16.632420.0002
Wald7.887620.0194

Analysis of Maximum Likelihood Estimates
ParameterDFEstimateStandard
Error
Wald
Chi-Square
Pr > ChiSq
Intercept1-2.87541.32084.73950.0295
LogRate14.56171.83806.15970.0131
LogVolume15.17931.86487.71360.0055

Odds Ratio Estimates
EffectPoint Estimate95% Wald
Confidence Limits
LogRate95.7442.610>999.999
LogVolume177.5624.592>999.999

Association of Predicted Probabilities and
Observed Responses
Percent Concordant93.7Somers' D0.874
Percent Discordant6.3Gamma0.874
Percent Tied0.0Tau-a0.448
Pairs380c0.937


The INFLUENCE option displays the values of the explanatory variables (LogRate and LogVolume) for each observation, a column for each diagnostic produced, and the case number that represents the sequence number of the observation (Output 73.6.2).

Output 73.6.2: Regression Diagnostics from the INFLUENCE Option

Regression Diagnostics
Case
Number
CovariatesPearson ResidualDeviance ResidualHat Matrix DiagonalIntercept DfBetaLogRate DfBetaLogVolume DfBetaConfidence Interval
Displacement C
Confidence Interval
Displacement
CBar
Delta DevianceDelta Chi-Square
LogRateLogVolume
1-0.19241.30830.22050.30820.0927-0.01650.01930.05560.005480.004970.10000.0536
20.08621.25280.13490.18990.0429-0.01340.01510.02610.0008530.0008160.03690.0190
30.91630.22310.29230.40490.0612-0.04920.06600.05890.005930.005570.16950.0910
40.4055-0.28773.51812.27750.08671.0734-0.9302-1.01801.28731.17566.362613.5523
51.1632-0.22310.52870.70210.1158-0.08320.14110.05830.04140.03660.52960.3161
61.2528-0.35670.60900.79430.1524-0.09220.17100.03810.07870.06670.69760.4376
7-0.2877-0.5108-0.0328-0.04640.00761-0.002800.002740.002658.321E-68.258E-60.002160.00109
80.53060.0953-1.0196-1.19390.0559-0.14440.06130.05700.06520.06161.48701.1011
9-0.2877-0.1054-0.0938-0.13230.0342-0.01780.01730.01530.0003220.0003110.01780.00911
10-0.7985-0.1054-0.0293-0.04140.00721-0.002450.002460.002116.256E-66.211E-60.001720.000862
11-0.5621-0.2231-0.0370-0.05230.00969-0.003610.003580.003190.0000140.0000130.002740.00138
121.0116-0.5978-0.5073-0.67680.1481-0.11730.06470.16510.05250.04470.50280.3021
131.0986-0.5108-0.7751-0.97000.1628-0.0931-0.009460.17750.13950.11681.05770.7175
140.84590.33650.25590.35620.0551-0.04140.05380.05270.004040.003820.13070.0693
151.3218-0.28770.43520.58900.1336-0.09400.14080.06430.03370.02920.37610.2186
160.49470.83290.15760.22150.0402-0.01980.02340.03070.001080.001040.05010.0259
170.47001.16320.07090.10010.0172-0.006300.007010.009140.0000890.0000880.01010.00511
180.3471-0.16252.90622.11920.09540.9595-0.8279-0.84770.98450.89065.38179.3363
190.05830.5306-1.0718-1.23680.1315-0.25910.2024-0.004880.20030.17401.70371.3227
200.58780.58780.24050.33530.0525-0.03310.04210.05180.003380.003200.11560.0610
210.6931-0.9163-0.1076-0.15170.0373-0.01800.01580.02080.0004650.0004480.02350.0120
220.3075-0.0513-0.4193-0.56910.1015-0.14490.12370.11790.02210.01990.34370.1956
230.30010.3001-1.0242-1.19780.0761-0.19610.12750.03570.09350.08641.52121.1355
240.30750.4055-1.3684-1.45270.0717-0.12810.0410-0.10040.15580.14472.25502.0171
250.57660.47000.33470.46080.0587-0.04030.05700.07080.007410.006980.21930.1190
260.4055-0.5108-0.1595-0.22410.0548-0.03660.03290.03730.001560.001470.05170.0269
270.40550.58780.36450.49950.0661-0.03270.04960.07880.01010.009410.25890.1423
280.6419-0.0513-0.8989-1.08830.0647-0.14230.06170.10250.05970.05591.24040.8639
29-0.05130.64190.89811.08760.16820.2367-0.19500.02860.19610.16311.34600.9697
30-0.91630.4700-0.0992-0.14000.0507-0.02240.02270.01590.0005540.0005260.02010.0104
31-0.28770.99330.61980.80640.24590.1165-0.09960.13220.16610.12530.77550.5095
32-3.50660.8544-0.00073-0.001030.000022-3.22E-63.405E-62.48E-61.18E-111.18E-111.065E-65.324E-7
330.60430.0953-1.2062-1.34020.0510-0.0882-0.0137-0.002160.08240.07821.87441.5331
340.78850.09530.54470.72090.0601-0.04250.08770.06710.02020.01900.53870.3157
350.69310.18230.54040.71590.0552-0.03400.07550.07110.01800.01700.52950.3091
361.2030-0.22310.48280.64730.1177-0.08670.13810.06310.03520.03110.45010.2641
370.6419-0.0513-0.8989-1.08830.0647-0.14230.06170.10250.05970.05591.24040.8639
380.6419-0.2877-0.4874-0.65290.1000-0.13950.10320.13970.02930.02640.45260.2639
390.48550.26240.70530.89870.05310.03260.01900.04890.02950.02790.83550.5254


Because ODS Graphics is enabled, influence plots are displayed in Outputs Output 73.6.3 through Output 73.6.5. For general information about ODS Graphics, see Chapter 21: Statistical Graphics Using ODS. For specific information about the graphics available in the LOGISTIC procedure, see the section ODS Graphics. The vertical axis of an index plot represents the value of the diagnostic, and the horizontal axis represents the sequence (case number) of the observation. The index plots are useful for identification of extreme values.

The index plots of the Pearson residuals and the deviance residuals (Output 73.6.3) indicate that case 4 and case 18 are poorly accounted for by the model. The index plot of the diagonal elements of the hat matrix (Output 73.6.3) suggests that case 31 is an extreme point in the design space. The index plots of DFBETAS (Output 73.6.5) indicate that case 4 and case 18 are causing instability in all three parameter estimates. The other four index plots in Outputs Output 73.6.3 and Output 73.6.4 also point to these two cases as having a large impact on the coefficients and goodness of fit.

Output 73.6.3: Residuals, Hat Matrix, and CI Displacement C

Residuals, Hat Matrix, and CI Displacement C


Output 73.6.4: CI Displacement CBar, Change in Deviance and Pearson Chi-Square

CI Displacement CBar, Change in Deviance and Pearson Chi-Square


Output 73.6.5: DFBETAS Plots

DFBETAS Plots


Other versions of diagnostic plots can be requested by specifying the appropriate options in the PLOTS= option. For example, the following statements produce three other sets of influence diagnostic plots: the PHAT option plots several diagnostics against the predicted probabilities (Output 73.6.6), the LEVERAGE option plots several diagnostics against the leverage (Output 73.6.7), and the DPC option plots the deletion diagnostics against the predicted probabilities and colors the observations according to the confidence interval displacement diagnostic (Output 73.6.8). The LABEL option displays the observation numbers on the plots. In all plots, you are looking for the outlying observations, and again cases 4 and 18 are noted.

proc logistic data=vaso plots(only label)=(phat leverage dpc);
   model Response=LogRate LogVolume;
run;

Output 73.6.6: Diagnostics versus Predicted Probability

Diagnostics versus Predicted Probability


Output 73.6.7: Diagnostics versus Leverage

Diagnostics versus Leverage


Output 73.6.8: Three Diagnostics

Three Diagnostics