e_lm_bestsubset: Best subset selection returns results sorted by BIC

View source: R/e_lm_bestsubset.R

e_lm_bestsubsetR Documentation

Best subset selection returns results sorted by BIC

Description

Best subset selection returns results sorted by BIC

Usage

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

## Not run: 
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

## End(Not run)

erikerhardt/erikmisc documentation built on April 17, 2025, 10:48 a.m.