how to model all relationships between independent variables in R?
问题 I have a small data set with 4 independent (call them a, b, c, d) and 1 dependent variables. Since there are few independent variables, I want to explore all combinations of these variables. There can be only 14 models (a, b, c, d, a+b, a+c, a+d, b+c, b+d, c+d, a+b+c, a+b+d, b+c+d, a+b+c+d). I build all models by hand and it is time-consuming. Therefore I want to automatize it. Is it possible in R? glm(dep ~ a, family = "binomial", data = data) glm(dep ~ b + c, family = "binomial", data =