powered by
Adaptation of existing methods based on AIC/BIC.
best.subsets(model, nbest = 5, nvmax, digits, force.in = "NULL")
No return, only print.
object class lm to select effects from.
lm
numeric indicating number of models to report of each size.
numeric
numeric maximum size of subsets to examine.
numeric giving number of digits in format of output.
character vector indicating effects to keep in all models.
character
Kristian Hovde Liland
F-based versions of built in subset method.
data <- data.frame(y = rnorm(8), x = factor(c('a','a','a','a','b','b','b','b')), z = factor(c('a','a','b','b','a','a','b','b'))) mod <- lm(y ~ x + z, data=data) best.subsets(mod)
Run the code above in your browser using DataLab