Display a forest plot of regression parameters for a given "lm" or "glm" model.

forest_plot(x, digits = 2, ci = 0.95)

Arguments

x

object of class "lm" or "glm"

digits

number of decimal digits to display

ci

confidence level (default = 0.95)

Value

a ggplot2 graph

Details

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.

See also

Examples

#######################
# 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...