test_lm <- lm(mpg ~ cyl * hp, data = mtcars)
test_glm <- glm(am ~ cyl * hp, data = mtcars, family = binomial)
# Format linear model overall statistics
format_stats(test_lm)
# Format linear model term statistics
format_stats(test_lm, term = "cyl")
# Format generalized linear model overall statistics
format_stats(test_glm)
# Format generalized linear model term statistics
format_stats(test_glm, term = "cyl")
# Remove italics and make degrees of freedom subscripts
format_stats(test_lm, term = "cyl", italics = FALSE, dfs = "sub")
# Change digits and add leading zero to p-value
format_stats(test_lm, term = "hp", digits = 3, pdigits = 4, pzero = TRUE)
# Format for LaTeX
format_stats(test_lm, term = "hp", type = "latex")
Run the code above in your browser using DataLab