R/print_model_params_p.R
print_model_params_p.Rd
This function takes a model object and a predictor, and prints the output in parenthesis. Includes confidence intervals, stat type and p-values.
print_model_params_p(model, predictor, latex = TRUE)
library(lme4)
library(lmerTest)
#>
#> Attaching package: ‘lmerTest’
#> The following object is masked from ‘package:lme4’:
#>
#> lmer
#> The following object is masked from ‘package:stats’:
#>
#> step
mod1 <- lm(mpg ~ wt, data = mtcars)
mod2 <- lmer(Reaction ~ 1 + Days + (1|Subject), data = sleepstudy,
REML = FALSE)
print_model_params_p(model = mod1, predictor = "wt", latex = FALSE)
#> [1] "(CI = [-6.49, -4.2]; *t* = -9.56; *p* < .001)"
print_model_params_p(model = mod2, predictor = "Days")
#> [1] "(CI = [8.88, 12.05]; \\emph{t} = 13.06; \\emph{p} < .001)"