I used regsubsets to search for models. Is it possible to automatically create all lm
from the list of parameter selections?
library(leaps)
leaps<-regsubsets(y ~ x1 + x2 + x3, data, nbest=1, method="exhaustive")
summary(leaps)$which
(Intercept) x1 x2 x3
1 TRUE FALSE FALSE TRUE
2 TRUE FALSE TRUE TRUE
3 TRUE TRUE TRUE TRUE
Now i would manually do model_1 <- lm(y ~ x3)
and so on. How can this be automated to have them in a list?