[prev in list] [next in list] [prev in thread] [next in thread]
List: r-help
Subject: Re: [R] error message in plot(aov-object) -- repost
From: Peter Dalgaard <p.dalgaard () biostat ! ku ! dk>
Date: 2004-01-16 12:29:36
Message-ID: x2eku0m5zj.fsf () biostat ! ku ! dk
[Download RAW message or body]
Uwe Ligges <ligges@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@biostat.ku.dk) FAX: (+45) 35327907
______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic