Is there a method in R to run a GLM for each of the different variables in a data frame with a different combinations e.g.
If I have 4 explanatory variables I can model Y as
m1 = glm(Y ~ V1, data = d)
m2 = glm(Y ~ V1 + V2, data = d)
m3 = glm(Y ~ V1 + V2 + V3, data = d)
m4 = glm(Y ~ V1 + V2 + V3 + V4, data = d)
However, I can also have
m5 = glm(Y ~ V1 + V2 + V4, data = d)
and so on.
Is there a method in R to select all of the different possible combinations of variables within a data frame to see which variables act as the best predictors?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…