1 Mar 2009 04:55
[Rd] Wishlist for plot.lm() (PR#13560)
<john.maindonald <at> anu.edu.au>
2009-03-01 03:55:06 GMT
2009-03-01 03:55:06 GMT
Full_Name: John Maindonald
Version: R-2.8.1
OS: MacOS X 10.5.6
Submission from: (NULL) (203.173.3.75)
The following code demonstrates an annoyance with plot.lm():
library(DAAGxtras)
x11(width=3.75, height=4)
nihills.lm <- lm(log(time) ~ log(dist) + log(climb), data = nihills)
plot(nihills.lm, which=5)
OR try the following
xy <- data.frame(x=c(3,1:5), y=c(-2, 1:5))
plot(lm(y ~ x, data=xy), which=5)
The "Cook's distance" text overplots the label for the point with the smallest
residual. This is an issue when the size of the plot is much less than the
default, and the pointsize is not reduced proportionately.
I suggest the following:
xx <- hii
xx[xx >= 1] <- NA
## Insert new code
fracht <- (1.25*par()$cin[2])/par()$pin[2]
ylim[1] <- ylim[1] - diff(ylim)*max(0, fracht-0.04)
## End insert new code
plot(xx, rsp, xlim = c(0, max(xx, na.rm = TRUE)),
ylim = ylim, main = main, xlab = "Leverage",
ylab = ylab5, type = "n", ...)
(Continue reading)
RSS Feed