Pearson Residual Calculation for Logistic Regression in SAS

121 Views Asked by At

I am currently reading through the third edition of Applied Logistic Regression by David Hosmer, Jr., Stanley Lemeshow, and Rodney Sturdivant, and I'm on the section regarding logistic regression diagnostics and the Pearson residual, $$ r_i = \frac{(y_j - m_j\hat{\pi}_j)}{\sqrt{m_j\hat{\pi}_j(1 - \hat{\pi}_j})}, $$ where:

$j$ denotes a particular covariate pattern,

$m_j$ is the number of instances with covariate pattern $j$,

$y_j$ is the sum of the dependent, dichotomous variable over all instances with covariate pattern $j$, and

$\hat{\pi}_j$ is the estimated logistic probability based on the fitted model for the covariate pattern $j$.

I picked on a particular covariate pattern where all of its outcomes were equal to 0. Thus, the Pearson residual, taking covariate patterns into consideration, should be $$ r_i = -\sqrt{m_j}\sqrt{\frac{\hat{\pi}_j}{(1 - \hat{\pi}_j)}}. $$ However, upon outputting the results to a table with RESCHI = PEARSON_RESIDUAL and observing the Pearson residual for that covariate pattern, I get instead $$ r_i = \sqrt{\frac{\hat{\pi}_j}{(1 - \hat{\pi}_j)}}. $$

My question is this: Is there an option in SAS that takes into account the number of instances for each covariate pattern?

I've tried using SCALE = NONE AGGREGATE as options in the MODEL statement, but I keep getting the same results for the Pearson residuals.

Any help would be appreciated.

Notes:

(1) I'm using the GLOW500 data set, and I"m using the model outlined in Table 4.16 from the aforementioned book.