get_coef: Get coefficient values from list of coefficients

View source: R/get_coef.R

get_coefR Documentation

Get coefficient values from list of coefficients

Description

Use get_coeff(coeff, clist) to retrieve the value of coeff from clist

Usage

get_coef(coef, clist)

Arguments

coef

Which coefficient to look up

clist

The list of coefficients to use

Details

Or use function factor make_coef_getter to make it easier to retrieve values from specific lists when you have multiple lists.

Value

Formatted value string for the coefficient

Examples

mdl <- lm(mpg ~ cyl * gear, data = mtcars) # Create model
coefs <- enlist_coefs(mdl) # Create coefficients
get_coef1 <- make_coef_getter(mdl) # Using the model object directly
get_coef2 <- make_coef_getter(coefs) # Using the list of coefficients we made

# All are equivalent
get_coef("cyl:gear", coefs)
get_coef1("cyl:gear")
get_coef2("cyl:gear")



tsostarics/sostools documentation built on Nov. 22, 2022, 7:26 p.m.