clean_glm {dvmisc} | R Documentation |
Create a Clean Summary Table from a glm Object
Description
Formats a glm
object for printing to console or
inputting to kable
.
Usage
clean_glm(fit, columns = NULL, expand_factors = TRUE,
variable_labels = NULL, prep_kable = FALSE, decimals = 2,
formatp_list = NULL)
Arguments
fit |
Object returned from |
columns |
Character vector specifying what columns to include. Choices
for each element are |
expand_factors |
Logical value for whether to include two blank rows for factor variables (name of variable and reference group). |
variable_labels |
Character vector in case you want labels other than the variable names. |
prep_kable |
Logical value for whether to prepare for
printing via |
decimals |
Numeric value of vector specifying number of decimal places for each column. |
formatp_list |
Arguments to pass to |
Value
Data frame.
Examples
fit <- glm(mpg ~ wt + as.factor(cyl) + hp, data = mtcars)
clean_glm(fit)
fit %>% clean_glm(prep_kable = TRUE) %>% knitr::kable()