Skip to content

standardized residuals (rstandard & plot.lm) (PR#8468)

1 message · Heather Turner

#
This bug is not quite fixed - the example from my original report now =
works using R-2.2.1, but

plot(Uniform, 6)

does not. The bug is due to
 if (show[6]) {
        ymx <- max(cook, na.rm =3D TRUE) * 1.025
        g <- hatval/(1 - hatval) # Potential division by zero here #
        plot(g, cook, xlim =3D c(0, max(g)), ylim =3D c(0, ymx),=20
            main =3D main, xlab =3D "Leverage", ylab =3D "Cook's distance",=
=20
            xaxt =3D "n", type =3D "n", ...)
...

All other values of 'which' seem to work fine. Sorry not to have checked =
this in the beta version,

Heather
Curiously, I was just looking at that, since I believe the answer =
should=20
be NaN, and some optimizing compilers/fast BLASes are not giving that.
(There's an example in reg-test-3.R.)  So I think we need to return NaN=20
when hat is within rounding error of 1.

My take is that plot.lm should handle this: you will see most but not =
all=20
cases have na.rm=3DTRUE in calculating ylim, but as Inf is theoretically
impossible it has not been considered.

Note that plot.lm does not use rstandard and so needs a separate fix.

Thanks for the report
On Tue, 6 Dec 2005 Heather.Turner at warwick.ac.uk wrote:

            
plot.lm
zero. This
14, 8,
25, 90,
8,
71,
"7",
"6", "7",
,
tus)
the hat
FALSE),
--=20
Brian D. Ripley,                  ripley at stats.ox.ac.uk=20
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/=20
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595