get_model_coefs: Extract model coefficients from a list of models

get_model_coefsR Documentation

Extract model coefficients from a list of models

Description

Uses broom::tidy to extract coefficients from models. If the model doesn't support this, it will fail. There is a special case for rlm models, where the p value is calculated manually. If the model is of class rms, then the summary.lm function is used to extract coefficients. There is some special handling for factor levels, where the levels are made nicer, but this is not done for rms models.

Usage

get_model_coefs(models, conf.level = 0.95, nicer_factor_levels = T)

Arguments

models

A list of models

conf.level

Which confidence level to use. Default is .95.

nicer_factor_levels

Whether to make factor levels nicer. Default is TRUE.

Value

Data frame

Examples

list(
a = lm(Sepal.Width ~ Sepal.Length, data = iris),
b = lm(Sepal.Width ~ Sepal.Length + Petal.Width, data = iris)
) %>% get_model_coefs()

Deleetdk/kirkegaard documentation built on April 27, 2024, 3:26 p.m.