[R] Deviance Residuals
David Winsemius
dwinsemius at comcast.net
Fri Aug 20 14:20:36 CEST 2010
On Aug 20, 2010, at 5:54 AM, Iasonas Lamprianou wrote:
> Dear all,
>
> I am running a logistic regression and this is the output:
>
> glm(formula = educationUniv ~ brncntr, family = binomial)
>
> Deviance Residuals:
> Min 1Q Median 3Q Max # αυτά είναι
> τα υπόλοιπα
> -0.8825 -0.7684 -0.7684 1.5044 1.6516
>
> Coefficients:
> Estimate Std. Error z value Pr(>|z|)
> (Intercept) -1.06869 0.01155 -92.487 <2e-16 ***
> brncntrNo 0.32654 0.03742 8.726 <2e-16 ***
> ---
> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
>
> (Dispersion parameter for binomial family taken to be 1)
>
> Null deviance: 49363 on 42969 degrees of freedom
> Residual deviance: 49289 on 42968 degrees of freedom
> AIC: 49293
>
>
> I thought that the residuals should all be restricted in the range 0
> to 1 (since I am predicting a binary outcome).
The internal regression calculations are done on the log-odds scale so
the working residuals are on that scale. Those are stored in the
glm.obj as the "residuals" item. I believe that if you tried
mean(glm.obj$residuals) you should get 0. Presumably the deviance
residuals are offered in preference to the working residuals because
the deviance residual's use as an influence measure is made readily
interpretable by reference to chi-square statistics. Page 205 of the
Hastie and Pregibon citation has all the definitions.
--
David.
> I read many posts on this list and I realized that there are
> four(!?) different types of residuals. I need a simple account of
> these four types of residuals, if anyone can help it will be great.
>
> residuals(glm1, "response")
> residuals(glm1, "pearson")
> residuals(glm1, "deviance")
> residuals(glm1, "working") - especially this one confuses me a lot!
>
> What is the "working" option and how is this different?
>
> Thank you
> Jason
>
> Dr. Iasonas Lamprianou
>
--
David Winsemius, MD
West Hartford, CT
More information about the R-help
mailing list