forest_plot.Rd
Display a forest plot of regression parameters for a
given "lm"
or "glm"
model.
forest_plot(x, digits = 2, ci = 0.95)
object of class "lm" or "glm"
number of decimal digits to display
confidence level (default = 0.95)
a ggplot2 graph
For linear models, the plot displays the standardized coefficients and their confidence intervals. For logistic regression models, the plot displays odds ratios and their confidence intervals. Effects are plotted in the same order as they appear in the model.
#######################
# multiple regression #
#######################
fit <- lm(mpg ~ ., data = auto_mpg)
forest_plot(fit)
#######################
# logistic regression #
#######################
fit2 <- glm(caesarian ~ ., family = binomial, data = caesarian)
forest_plot(fit2)
#> Waiting for profiling to be done...