Created
June 27, 2014 15:46
-
-
Save jtrecenti/5bdea5780df47d0116d7 to your computer and use it in GitHub Desktop.
exemplo onde y é explicado por x + z mas não por z
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x <- rnorm(1000) | |
z <- runif(1000) | |
d <- data.frame(x = x, z = z, y= x + z/10 + rnorm(1000, sd=.001)) | |
cor(d) | |
summary(lm(y~x+z, data=d)) | |
summary(lm(y~x, data=d)) | |
summary(lm(y~z, data=d)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Outro exemplo: aqui eu gero o y como uma função determinística de x, z1, z2, z3, z4, z5.
Parece que a função glm dá bug, mas a função step acaba tirando as variáveis z...