The LOGISTIC Procedure

Regression Diagnostics

For binary response data, regression diagnostics developed by Pregibon (1981) can be requested by specifying the INFLUENCE option. For diagnostics available with conditional logistic regression, see the section Regression Diagnostic Details. These diagnostics can also be obtained from the OUTPUT statement.

This section uses the following notation:

r Subscript j Baseline comma n Subscript j Baseline

r Subscript j is the number of event responses out of n Subscript j trials for the jth observation. If events/trials syntax is used, r Subscript j is the value of events and n Subscript j is the value of trials. For single-trial syntax, n Subscript j Baseline equals 1, and r Subscript j Baseline equals 1 if the ordered response is 1, and r Subscript j Baseline equals 0 if the ordered response is 2.

w Subscript j

is the weight of the jth observation.

pi Subscript j

is the probability of an event response for the jth observation given by pi Subscript j Baseline equals upper F left-parenthesis alpha plus bold-italic beta prime bold x Subscript j Baseline right-parenthesis, where upper F left-parenthesis dot right-parenthesis is the inverse link function.

ModifyingAbove bold-italic beta With caret

is the maximum likelihood estimate (MLE) of left-parenthesis alpha comma beta 1 comma ellipsis comma beta Subscript s Baseline right-parenthesis prime.

ModifyingAbove bold upper V With caret left-parenthesis ModifyingAbove bold-italic beta With caret right-parenthesis

is the estimated covariance matrix of ModifyingAbove bold-italic beta With caret.

ModifyingAbove p With caret Subscript j Baseline comma ModifyingAbove q With caret Subscript j Baseline

ModifyingAbove p With caret Subscript j is the estimate of pi Subscript j evaluated at ModifyingAbove bold-italic beta With caret, and ModifyingAbove q With caret Subscript j Baseline equals 1 minus ModifyingAbove p With caret Subscript j.

Pregibon (1981) suggests using the index plots of several diagnostic statistics to identify influential observations and to quantify the effects on various aspects of the maximum likelihood fit. In an index plot, the diagnostic statistic is plotted against the observation number. In general, the distributions of these diagnostic statistics are not known, so cutoff values cannot be given for determining when the values are large. However, the IPLOTS and INFLUENCE options in the MODEL statement and the PLOTS option in the PROC LOGISTIC statement provide displays of the diagnostic values, allowing visual inspection and comparison of the values across observations. In these plots, if the model is correctly specified and fits all observations well, then no extreme points should appear.

The next five sections give formulas for these diagnostic statistics.

Hat Matrix Diagonal (Leverage)

The diagonal elements of the hat matrix are useful in detecting extreme points in the design space where they tend to have larger values. The jth diagonal element is

StartLayout 1st Row  h Subscript j Baseline equals StartLayout Enlarged left-brace 1st Row 1st Column ModifyingAbove w With tilde Subscript j Baseline left-parenthesis 1 comma bold x prime Subscript j right-parenthesis ModifyingAbove bold upper V With caret left-parenthesis ModifyingAbove bold-italic beta With caret right-parenthesis left-parenthesis 1 comma bold x prime Subscript j right-parenthesis Superscript prime Baseline 2nd Column Fisher scoring 2nd Row 1st Column ModifyingAbove w With caret Subscript j Baseline left-parenthesis 1 comma bold x prime Subscript j right-parenthesis ModifyingAbove bold upper V With caret left-parenthesis ModifyingAbove bold-italic beta With caret right-parenthesis left-parenthesis 1 comma bold x prime Subscript j right-parenthesis Superscript prime Baseline 2nd Column Newton hyphen Raphson EndLayout EndLayout

where

StartLayout 1st Row 1st Column w overTilde Subscript j 2nd Column equals 3rd Column StartFraction w Subscript j Baseline n Subscript j Baseline Over ModifyingAbove p With caret Subscript j Baseline ModifyingAbove q With caret Subscript j Baseline left-bracket g prime left-parenthesis ModifyingAbove p With caret Subscript j Baseline right-parenthesis right-bracket squared EndFraction 2nd Row 1st Column ModifyingAbove w With caret Subscript j 2nd Column equals 3rd Column w overTilde Subscript j Baseline plus StartFraction w Subscript j Baseline left-parenthesis r Subscript j Baseline minus n Subscript j Baseline ModifyingAbove p With caret Subscript j Baseline right-parenthesis left-bracket ModifyingAbove p With caret Subscript j Baseline ModifyingAbove q With caret Subscript j Baseline g double-prime left-parenthesis ModifyingAbove p With caret Subscript j Baseline right-parenthesis plus left-parenthesis ModifyingAbove q With caret Subscript j Baseline minus ModifyingAbove p With caret Subscript j Baseline right-parenthesis g prime left-parenthesis ModifyingAbove p With caret Subscript j Baseline right-parenthesis right-bracket Over left-parenthesis ModifyingAbove p With caret Subscript j Baseline ModifyingAbove q With caret Subscript j Baseline right-parenthesis squared left-bracket g prime left-parenthesis ModifyingAbove p With caret Subscript j Baseline right-parenthesis right-bracket cubed EndFraction EndLayout

and g prime left-parenthesis dot right-parenthesis and g double-prime left-parenthesis dot right-parenthesis are the first and second derivatives of the link function g left-parenthesis dot right-parenthesis, respectively.

For a binary response logit model, the hat matrix diagonal elements are

h Subscript j Baseline equals w Subscript j Baseline n Subscript j Baseline ModifyingAbove p With caret Subscript j Baseline ModifyingAbove q With caret Subscript j Baseline left-parenthesis 1 comma bold x prime Subscript j right-parenthesis ModifyingAbove bold upper V With caret left-parenthesis ModifyingAbove bold-italic beta With caret right-parenthesis StartBinomialOrMatrix 1 Choose bold x Subscript j EndBinomialOrMatrix

If the estimated probability is extreme (less than 0.1 or greater than 0.9, approximately), then the hat diagonal might be greatly reduced in value. Consequently, when an observation has a very large or very small estimated probability, its hat diagonal value is not a good indicator of the observation’s distance from the design space (Hosmer and Lemeshow 2000, p. 171).

Residuals

Residuals are useful in identifying observations that are not explained well by the model. Pearson residuals are components of the Pearson chi-square statistic and deviance residuals are components of the deviance. The Pearson residual for the jth observation is

chi Subscript j Baseline equals StartFraction StartRoot w Subscript j Baseline EndRoot left-parenthesis r Subscript j Baseline minus n Subscript j Baseline ModifyingAbove p With caret Subscript j Baseline right-parenthesis Over StartRoot n Subscript j Baseline ModifyingAbove p With caret Subscript j Baseline ModifyingAbove q With caret Subscript j Baseline EndRoot EndFraction

The Pearson chi-square statistic is the sum of squares of the Pearson residuals.

The deviance residual for the jth observation is

StartLayout 1st Row 1st Column d Subscript j Baseline equals 2nd Column StartLayout Enlarged left-brace 1st Row 1st Column minus StartRoot minus 2 w Subscript j Baseline n Subscript j Baseline log left-parenthesis ModifyingAbove q With caret Subscript j Baseline right-parenthesis EndRoot 2nd Column if r Subscript j Baseline equals 0 2nd Row 1st Column plus-or-minus StartRoot 2 w Subscript j Baseline left-bracket r Subscript j Baseline log left-parenthesis StartFraction r Subscript j Baseline Over n Subscript j Baseline ModifyingAbove p Subscript j Baseline With caret EndFraction right-parenthesis plus left-parenthesis n Subscript j Baseline minus r Subscript j Baseline right-parenthesis log left-parenthesis StartFraction n Subscript j Baseline minus r Subscript j Baseline Over n Subscript j Baseline ModifyingAbove q With caret Subscript j Baseline EndFraction right-parenthesis right-bracket EndRoot 2nd Column if 0 less-than r Subscript j Baseline less-than n Subscript j Baseline 3rd Row 1st Column StartRoot minus 2 w Subscript j Baseline n Subscript j Baseline log left-parenthesis ModifyingAbove p With caret Subscript j Baseline right-parenthesis EndRoot 2nd Column if r Subscript j Baseline equals n Subscript j Baseline EndLayout EndLayout

where the plus (minus) in plus-or-minus is used if r Subscript j Baseline slash n Subscript j is greater (less) than ModifyingAbove p With caret Subscript j. The deviance is the sum of squares of the deviance residuals.

The STDRES option in the INFLUENCE and PLOTS=INFLUENCE options computes three more residuals (Collett 2003). The Pearson and deviance residuals are standardized to have approximately unit variance:

StartLayout 1st Row 1st Column e Subscript p Sub Subscript j 2nd Column equals 3rd Column StartFraction chi Subscript j Baseline Over StartRoot 1 minus h Subscript j Baseline EndRoot EndFraction 2nd Row 1st Column e Subscript d Sub Subscript j 2nd Column equals 3rd Column StartFraction d Subscript j Baseline Over StartRoot 1 minus h Subscript j Baseline EndRoot EndFraction EndLayout

The likelihood residuals, which estimate components of a likelihood ratio test of deleting an individual observation, are a weighted combination of the standardized Pearson and deviance residuals

StartLayout 1st Row 1st Column e Subscript l Sub Subscript j 2nd Column equals 3rd Column normal s normal i normal g normal n left-parenthesis r Subscript j Baseline minus n Subscript j Baseline ModifyingAbove p With caret Subscript j Baseline right-parenthesis StartRoot h Subscript j Baseline e Subscript p Sub Subscript j Subscript Superscript 2 Baseline plus left-parenthesis 1 minus h Subscript j Baseline right-parenthesis e Subscript d Sub Subscript j Subscript Superscript 2 Baseline EndRoot EndLayout

DFBETAS

For each parameter estimate, the procedure calculates a DFBETAS diagnostic for each observation. The DFBETAS diagnostic for an observation is the standardized difference in the parameter estimate due to deleting the observation, and it can be used to assess the effect of an individual observation on each estimated parameter of the fitted model. Instead of reestimating the parameter every time an observation is deleted, PROC LOGISTIC uses the one-step estimate. See the section Predicted Probability of an Event for Classification. For the jth observation, the DFBETAS are given by

DFBETAS i Subscript j Baseline equals bold upper Delta Subscript i Baseline ModifyingAbove bold-italic beta With caret Subscript j Superscript 1 Baseline slash ModifyingAbove sigma With caret Subscript i Baseline

where i equals 0 comma 1 comma ellipsis comma s comma ModifyingAbove sigma With caret Subscript i Baseline is the standard error of the ith component of ModifyingAbove bold-italic beta With caret, and bold upper Delta Subscript i Baseline ModifyingAbove bold-italic beta With caret Subscript j Superscript 1 is the ith component of the one-step difference

bold upper Delta ModifyingAbove bold-italic beta With caret Subscript j Superscript 1 Baseline equals StartFraction w Subscript j Baseline left-parenthesis r Subscript j Baseline minus n Subscript j Baseline ModifyingAbove p With caret Subscript j Baseline right-parenthesis Over 1 minus h Subscript j Baseline EndFraction ModifyingAbove bold upper V With caret left-parenthesis ModifyingAbove bold-italic beta With caret right-parenthesis StartBinomialOrMatrix 1 Choose bold x Subscript j EndBinomialOrMatrix

bold upper Delta ModifyingAbove bold-italic beta With caret Subscript j Superscript 1 is the approximate change (ModifyingAbove bold-italic beta With caret minus ModifyingAbove bold-italic beta With caret Subscript j Superscript 1) in the vector of parameter estimates due to the omission of the jth observation. The DFBETAS are useful in detecting observations that are causing instability in the selected coefficients.

C and CBAR

C and CBAR are confidence interval displacement diagnostics that provide scalar measures of the influence of individual observations on ModifyingAbove bold-italic beta With caret. These diagnostics are based on the same idea as the Cook distance in linear regression theory (Cook and Weisberg 1982), but use the one-step estimate. C and CBAR for the jth observation are computed as

upper C Subscript j Baseline equals chi Subscript j Superscript 2 Baseline h Subscript j Baseline slash left-parenthesis 1 minus h Subscript j Baseline right-parenthesis squared

and

upper C overbar Subscript j Baseline equals chi Subscript j Superscript 2 Baseline h Subscript j Baseline slash left-parenthesis 1 minus h Subscript j Baseline right-parenthesis

respectively.

Typically, to use these statistics, you plot them against an index and look for outliers.

DIFDEV and DIFCHISQ

DIFDEV and DIFCHISQ are diagnostics for detecting ill-fitted observations; in other words, observations that contribute heavily to the disagreement between the data and the predicted values of the fitted model. DIFDEV is the change in the deviance due to deleting an individual observation while DIFCHISQ is the change in the Pearson chi-square statistic for the same deletion. By using the one-step estimate, DIFDEV and DIFCHISQ for the jth observation are computed as

DIFDEV equals d Subscript j Superscript 2 Baseline plus upper C overbar Subscript j Baseline

and

DIFCHISQ equals upper C overbar Subscript j Baseline slash h Subscript j Baseline
Last updated: December 09, 2022