Dear R-users,
I am trying to get a simple plot for a linear model. The following function
does the job
of getting all the plots of the lm function but the "main" plot.
multivarplot <-
function(...){
x1 <- rnorm(10); x2 <- rnorm(10); x3 <- rnorm(10)
y <- rnorm(10)
multivarfit <- lm(y ~ x1 + x2 + x3)
par(mfrow = c(3,2))
plot.lm(multivarfit)
}
where the "main" plot is graph of the variable (fitted : x1 + x2 + x3 ) against
y.
This is similar to the graph in Phil Spector's book (intro to the S and Splus)
p. 227.
It seems to be a very simple task but I cannot figure it out.
Thank you for any hint.
I use R 2.4.0 windows xp.
AA.
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.