n <- 100
x2 <- 1 : n
x1 <- .01 * x2 + runif(n, -.1, .1)
y = -x1 + x2 + rnorm(n, sd = .01)
summary(lm(y ~ x1))$coef
Coefficients (all significant): (Intercept): 1.618 x1: 95.854
summary(lm(y ~ x1 + x2))$coef
Coefficients (all significant): (Intercept): 0.0003683 x1: -1.0215256 x2: 1.0001909
How come the coefficients from x1 are so different in the two models? In our lecture we just got the image
but no good explanation. I prefer an intuitive explanation if possible. Thanks.