fork download
  1. x1 <- runif(1000, min=1, max=100)
  2. y <- runif(1000, min=1, max=100)
  3.  
  4. x2 <- y+x1
  5. cor(x1,x2)
  6. cor(x1,y)
  7. cor(x2,y)
  8. lm1 <- lm(y~x2)
  9. coef(lm1)
  10. lm2 <- lm(y~x2+x1)
  11. coef(lm2)
Success #stdin #stdout 0.31s 40524KB
stdin
Standard input is empty
stdout
[1] 0.6968696
[1] -0.02629743
[1] 0.698624
(Intercept)          x2 
 -0.7468987   0.5012250 
  (Intercept)            x2            x1 
 1.438037e-14  1.000000e+00 -1.000000e+00