Search Results

Search found 1 results on 1 pages for 'adibender'.

Page 1/1 | 1 

  • Strange behavior of I() in left-/right-hand side of formula

    - by adibender
    set.seed(98234) y <- rnorm(100) x <- rnorm(100) lm0 <- lm(y ~ x) lm1 <- lm(I(y) ~ I(x)) all work perfectly fine and I guess we can agree that ´lm0´ is what one would expect to happen. lm1 is equal to lm0 (judging by coefficients). So are set.seed(98234) lm3 <- lm(I(rnorm(100)) ~ rnorm(100)) set.seed(98234) lm4 <- lm(rnorm(100) ~ I(rnorm(100))) But when I() is on neither or both sides of the formula I don't get the results from above: set.seed(98234) lm2 <- lm(I(rnorm(100)) ~ I(rnorm(100))) set.seed(98234) lm5 <- lm(rnorm(100) ~ rnorm(100)) Any ideas why?

    Read the article

1