Best subset selection returns results sorted by BIC

e_lm_bestsubset(form, dat, nbest = 5)

Arguments

form

lm formula for full model

dat

data to use

nbest

number of models to return for each model size, default is 5

Value

tibble (data.frame) of selection results

Examples

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
}