R/print_model_params.R
print_model_params.Rd
This function takes a model object, a predictor, and a parameter and prints the numeric output.
print_model_params(model, predictor, parameter)
library(lme4)
mod1 <- lm(mpg ~ wt, data = mtcars)
mod2 <- lmer(Reaction ~ 1 + Days + (1|Subject), data = sleepstudy,
REML = FALSE)
print_model_params(model = mod1, predictor = "wt", parameter = "estimate")
#> [1] "-5.34"
print_model_params(model = mod2, predictor = "Days", parameter = "estimate")
#> [1] "10.47"