Last active
August 29, 2015 14:23
-
-
Save stefaneng/7bc1f69789a8e928e8ed to your computer and use it in GitHub Desktop.
Get significant variables in glm R
This file contains hidden or 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
# From http://stackoverflow.com/a/16154053/1351718 | |
# x is a 10 x 3 matrix | |
x = matrix(rnorm(3*10), ncol=3) | |
y = rnorm(10) | |
res = glm(y~x) | |
# ignore the intercept pval | |
summary(res)$coeff[-1,4] < 0.05 | |
## This answer http://stackoverflow.com/a/16154609/1351718 show how this can be automated to create a new glm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment