[R] plot(m, which = 1), where m is a lm linear model. What is 'which' doing?

Weidong Gu anopheles123 at gmail.com
Fri Sep 16 02:25:21 CEST 2011


Remember R is object-oriented. Your m is lm object, so check

?plot.lm

Weidong Gu

On Thu, Sep 15, 2011 at 8:14 PM, Idris Raja <idris.raja at gmail.com> wrote:
> Sample code from *R CookBook* (awesome book btw) *11.12: Finding the Best
> Power Transformation (Box-Cox) Procedure*
>
> require(MASS)
> x <- 10:100
> eps <- rnorm(length(x), sd = 5)
> y <- (x + eps)^(-1 / 1.5)
>
> m <- lm(y ~ x)
>
> # ***************** What does the *which* in this line do???
> ********************************************
> plot(m, which = 1)
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org 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.
>



More information about the R-help mailing list