Best subset selection returns results sorted by BIC
e_lm_bestsubset(form, dat, nbest = 5)
lm formula for full model
data to use
number of models to return for each model size, default is 5
tibble (data.frame) of selection results
if (FALSE) {
tab_best <-
e_lm_bestsubset(
form = stats::formula(mpg ~ cyl + disp + hp + gear)
, dat = erikmisc::dat_mtcars_e
)
op <- options(); # saving old options
options(width=100) # setting command window output text width wider
tab_best %>% print(n = Inf, width = Inf)
options(op); # reset (all) initial options
}