[R] error message in plot(aov-object) -- repost
Peter Dalgaard
p.dalgaard at biostat.ku.dk
Fri Jan 16 13:29:36 CET 2004
Uwe Ligges <ligges at statistik.uni-dortmund.de> writes:
> plot.lm() produces the error message, in particular the lines
>
> hii <- lm.influence(x, do.coef = FALSE)$hat
>
> which appears to be 1 in some cases, and
>
> rs <- r.w/(s * sqrt(1 - hii))
>
> (you get a division by zero and the outcome is Inf, hence it's not
> possible to scale the plot any more).
>
>
> I'd call it a bug, but I don't know what the bug really is. I'll think
> about it...
If the $hat is 1, then the residual is theoretically zero and you
should get 0/0 == NA which would be much less trouble.
Apparently, floating poing arithmetic makes it not quite so and you
get Inf in some cases. I'd expect that rs[hii==1] <- NA would fix
things up, although you might possibly need a fuzz factor (hii >
1-1e-10 or so).
--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
More information about the R-help
mailing list