Usually, the coefficients in a statistical model such as those returned from lm() need to be renamed for reporting, particularly when dummy/indicator variables are involved. This function returns the code to set up a rename tribble that can then be adjusted and passed, for instance, to the report_lm_with_std() function.

get_coef_rename_tribble(mod, show = TRUE)

Arguments

mod

A model (e.g., returned from lm). coef() is called to extract the coefficient names.

show

Logical - should the output be printed to the console. In any case, it is returned invisibly

Value

Code to be edited and passed to tibble::tribble() to create the coef_renames argument for report_lm_with_std() and similar functions. 'New' coefficient names are minimally transformed, but are primarily intended to be placeholders.

Examples

mod <- lm(mpg ~ wt, mtcars)
get_coef_rename_tribble(mod)
#> tibble::tribble(
#>   ~old,           ~new,           
#>    "(Intercept)",  "(Intercept)", 
#>    "wt",           "Wt"
#> )