stack_coeff {modelfactory} | R Documentation |
Stack coefficents, confidence intervals, and standard errors for n models.
Description
stack_coeff()
takes several lm or glm models, pulls out their coefficients,
standard errors, and confidence intervals, and stacks everything into a
tibble()
for easy comparison across models.
Usage
stack_coeff(..., ci = 0.95)
Arguments
... |
lm or glm models to summarize and combine. |
ci |
width of confidence, default = 0.95. |
Value
A tibble()
with coefficients, confidence intervals, and standard
errors.
Examples
# multiple lm example ----------------------------------
lm_1 = lm(mpg ~ cyl + disp + hp, data = mtcars)
lm_2 = lm(mpg ~ hp + drat + wt, data = mtcars)
lm_3 = lm(mpg ~ ., data = mtcars)
lm_combined = stack_coeff(lm_1, lm_2, lm_3)
lm_combined
# sometimes you might just want 1 model's summary ------
single_lm = stack_coeff(lm_1)
single_lm
# glm example ------------------------------------------
glm_1 = glm(vs ~ drat + hp, data = mtcars)
glm_2 = glm(vs ~ wt + qsec, data = mtcars)
glm_3 = glm(vs ~ ., data = mtcars)
glm_combined = stack_coeff(glm_1, glm_2, glm_3)
glm_combined
[Package modelfactory version 1.0.0 Index]