Skip to content
Prev 2792 / 20628 Next

lme vs. lm subset argument behaviour

There is a small error in my code below,
but it seems not to affect the difference
in behaviour observed.

On Thu, Sep 10, 2009 at 12:20 PM, Tobias Verbeke
<tobias.verbeke at gmail.com> wrote:
testLm <- function(x, retainValues = NULL){
  retainV <- if (is.null(retainValues)) rep(TRUE, nrow(x)) else retainValues
  lm(speed ~ dist, data = x,  subset = retainV)   # <--- x not cars
}

Best,
Tobias