fmt_regression.Rd
This function uses broom::tidy
from the broom
or broom.mixed
packages
to perform the initial model formatting. Review the fmt_regression
vignette
for detailed examples.
fmt_regression(x, exponentiate = FALSE, label = NULL, include = names(stats::model.frame(x)), show_yesno = NULL, conf.level = 0.95, intercept = FALSE, beta_fun = fmt_beta, pvalue_fun = fmt_pvalue)
x | regression model object |
---|---|
exponentiate | logical argument passed directly to
|
label | list of labels to write in the output. |
include | names of variables to include in output. Default is all variables. |
show_yesno | Vector of names of categorical and factor variables that
are |
conf.level | confidence level passed directly to |
intercept | logical argument indicates whether to include the intercept
in the output. Default is |
beta_fun | function to round and format beta coefficients. Default is |
pvalue_fun | function to round and format p-values. Default is |
#> #> N = 32 Coefficient 95% CI p-value #> mpg -3.33 -7.70, 1.04 0.13 #> factor(cyl) #> 4 Ref. #> 6 16.6 -30.9, 64.1 0.5 #> 8 88.1 29.1, 147 0.005mod2 <- glm(response ~ age + grade + stage, trial, family = binomial(link = "logit")) fmt_regression(mod2, exponentiate = TRUE)#> #> N = 183 OR 95% CI p-value #> Age, yrs 1.00 0.98, 1.02 0.9 #> Grade #> I Ref. #> II 0.55 0.25, 1.19 0.13 #> III 0.79 0.38, 1.64 0.5 #> T Stage #> T1 Ref. #> T2 1.49 0.64, 3.49 0.4 #> T3 0.65 0.26, 1.58 0.3 #> T4 0.51 0.22, 1.14 0.10library(lme4)#>mod_glmer <- glmer(am ~ hp + (1 | gear), mtcars, family = binomial) fmt_regression(mod_glmer, exponentiate = TRUE)#> #> N = 32 exp(Coefficient) 95% CI p-value #> hp 0.99 0.95, 1.03 0.5