BookmarkSubscribeRSS Feed
Quartz | Level 8

I am using logistic regression for a project, I want to examine whether prediction residuals differ between groups. From SAS output, it provides both Pearson residual and Deviance residual. If I want to examine whether prediction residual differ between groups, which one should I use, Pearson residual or Deviance residual? As SAS code below,reschi=pr is Pearson residual, resdev=dr is Deviance residual. I spent some time searching, but I haven't got clear idea yet, so I come here to ask the experts. thanks! 


proc logistic data=Have;
where first=1;
class aaa ppp;
model pass (event="1")=aaa ppp timeaftergrad schoolpass1;
output out=out_first p=prob xbeta=logit resdev=dr h=pii reschi=pr difchisq=difchi; 



You might get earlier response(s) when posting to the 'Statistical Procedures' board under Analytics.


Anyway, I suppose GROUP is not in your model as an explanatory variable? From your question and code I think you are running as many Logistic Regressions as there are GROUPs, correct?


I think you can use both Pearson residuals or Deviance residuals (one out of two or both).

You can also calculate plain 'prediction residuals'. I see your event equals "1". I assume you have a binary response and the non-event="0", correct?
Suppose your PROC LOGISTIC is modeling for a "1" (check the LOG to see which outcome your PROC LOGISTIC is modelling for):

  • if observation i has 1 as actual outcome and 0.78 (78%) as predicted outcome, then your plain prediction residual = 0.22.
  • if observation i has 0 as actual outcome and 0.78 (78%) as predicted outcome, then your plain prediction residual = 0.78.

You can also compare this 3rd type of residuals among groups.


Good luck,


Quartz | Level 8


Thanks much for your reply!

As to the plain 'prediction residuals' you said:

  • if observation i has 1 as actual outcome and 0.78 (78%) as predicted outcome, then your plain prediction residual = 0.22.

Could you please provide a document for me to refer, since this is something brand new to me. Can we calculate plain prediction residual in logistic regression as in regular regression, that is, y predict minus y observed? 



The word 'plain' comes from me, it's not standard terminology. I should be careful as English is not my mother tongue. Maybe I should have said 'RAW RESIDUALS' (or simply: prediction residuals) as I was simply referring to the observed y minus predicted y-values (as in a regular regression) but for a binary (0,1) response.

Plots of raw residuals from logistic regression are generally not so useful, but I think you can perfectly use these raw residuals to compare groups.

I will try to find a reference paper where some logistic regression diagnostics are based on raw residuals. I understand you may need more 'evidence'. I hope I can trace down one quickly. I will do that tomorrow as it's after 21h.00 here in Belgium.

I will check this track again tomorrow.





I think you have posted the same question in 'Statistical Procedures' under Analytics (probably on my recommendation, see 1st answer of mine).

Did you get enough information over there from @StatDave or do you still want me to search for a reference (I believe Dave has given some references, but only author names)?



Quartz | Level 8


I'll explore more on the references tatDave_sas provided. At the same time, I truly appreciate your time and help. Thank you so much!


Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.


Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 2 in conversation