[R] Standardized deviance residuals in plot.lm

Tatyana Krivobokova tkrivobokova at wiwi.uni-bielefeld.de
Thu Nov 30 15:24:53 CET 2006


It seems that the standardized deviance residulas, that one gets on 
plots of a glm.object x  with plot(x) are calculated as

r <- residuals(x)
s <- sqrt(deviance(x)/df.residual(x))
w <- weights(x)
hii <- lm.influence(x)$hat
r.w <- if (is.null(w)) r else (sqrt(w) * r)
rs <- r.w/(s * sqrt(1 - hii))

This implies that, for example, for binomial B(ni,pi) data the devaince 
residials (which are just r) are weighted not only with sqrt(1-hii), but 
also with 1/sqrt(ni) and s, leading to absurd values. As a result all 
leverage/outlier diagnostics is absolutly wrong.

Am I right and this should be reported as a bug?

Many thanks,
Tatyana

-- 
Tatyana Krivobokova
Bielefeld University
Department of Economics and Business Administration
PF 100131, D-33501 Bielefeld
+49 (0)521 106 4876
http://www.wiwi.uni-bielefeld.de/~krivobokova



More information about the R-help mailing list