[Rd] Standardized Pearson residuals
peter dalgaard
pdalgd at gmail.com
Thu Mar 17 18:08:18 CET 2011
On Mar 17, 2011, at 16:14 , Martin Maechler wrote:
>>>>>> peter dalgaard <pdalgd at gmail.com>
>>>>>> on Thu, 17 Mar 2011 15:45:01 +0100 writes:
>>
>
>> Back to the original question:
>
>> The current rstandard() code reads
>
> ## FIXME ! -- make sure we are following "the literature":
> rstandard.glm <- function(model, infl = lm.influence(model, do.coef=FALSE), ...)
> {
> res <- infl$wt.res # = "dev.res" really
> res <- res / sqrt(summary(model)$dispersion * (1 - infl$hat))
> res[is.infinite(res)] <- NaN
> res
> }
>
>> which is "svn blame" to ripley but that is due to the 2003
>> code reorganization (except for the infinity check from
>> 2005). So apparently, we have had that FIXME since
>> forever... and finding its author appears to be awkward
>> (Maechler, perhaps?).
>
> yes, almost surely
>
>> I did try Bretts code in lieu of the above (with a mod to
>> handle $dispersion) and even switched the default to use
>> the Pearson residuals. Make check-devel sailed straight
>> through apart from the obvious code/doc mismatch, so we
>> don't have any checks in place nor any examples using
>> rstandard(). I rather strongly suspect that there aren't
>> many user codes using it either.
>
>> It is quite tempting simply to commit the change (after
>> updating the docs). One thing holding me back though: I
>> don't know what "the literature" refers to.
>
> well, "the relevant publications on the topic" ...
> and now define that (e.g. using the three 'References' on the
> help page).
I count 5 actually... IIRC, the first two do not deal with glm diagnostics. The last two are by Fox, and, presumably, he is around to chime in if he wants. The middle one, by Williams, does define both standardized Pearson and standardized deviance residuals.
Or did you mean the three on ?glm.summaries? I would assume Davison and Snell to be the operative one, but I don't have it to hand.
Anyways, given that de default for residuals.glm is deviance residuals, I suppose that rstandard.glm should have the same default for consistency, and that is also the least disruptive variant. I see no reason not to make standardized Pearson residuals an option.
> Really, that's what I think I meant when I (think I) wrote that FIXME.
> The point then I think was that we had code "donations", and they
> partly were clearly providing functionality that was (tested)
> "correct" (according to e.g. McCoullagh & Nelder and probably
> another one or two text books I would have consulted ... no
> large Wikipedia back then),
> but also provided things for which there was nothing in "the
> literature", but as the author provided them with other good
> code, we would have put it in, as well....
> == my vague recollection from the past
>
> Martin
>
>> --
>> Peter Dalgaard Center for Statistics, Copenhagen Business
>> School Solbjerg Plads 3, 2000 Frederiksberg, Denmark
>> Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv:
>> PDalgd at gmail.com
>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
--
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
More information about the R-devel
mailing list