Quartz | Level 8

## logistic regression prediction residual

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;
run;``````
5 REPLIES 5
SAS Super FREQ

## Re: logistic regression prediction residual

Hello,

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,

Koen

Quartz | Level 8

## Re: logistic regression prediction residual

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?

SAS Super FREQ

## Re: logistic regression prediction residual

Hello,

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.

Cheers,

Koen

SAS Super FREQ

## Re: logistic regression prediction residual

Hello,

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)?

Thanks,

Koen

Quartz | Level 8

## Re: logistic regression prediction residual

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!

Discussion stats
• 5 replies
• 917 views
• 0 likes
• 2 in conversation