Idris Raja
2011-Sep-16 00:14 UTC
[R] plot(m, which = 1), where m is a lm linear model. What is 'which' doing?
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]]
Weidong Gu
2011-Sep-16 00:25 UTC
[R] plot(m, which = 1), where m is a lm linear model. What is 'which' doing?
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. >