# NOT RUN {
## load data
data("AirPollution", package = "lmSubsets")
###################
## basic usage ##
###################
## canonical example: fit all subsets
lm_all <- lmSubsets(mortality ~ ., data = AirPollution, nbest = 5)
lm_all
## plot RSS and BIC
plot(lm_all)
## summary statistics
summary(lm_all)
############################
## forced in-/exclusion ##
############################
lm_force <- lmSubsets(lm_all, include = c("nox", "so2"),
exclude = "whitecollar")
lm_force
# }
Run the code above in your browser using DataLab