forest_plot: Forest Plot

View source: R/forest_plot.R

forest_plotR Documentation

Forest Plot

Description

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

Usage

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)

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.

Value

a ggplot2 graph

See Also

info.lm, info.glm

Examples

#######################
# multiple regression #
#######################
fit <- lm(mpg ~ ., data = auto_mpg)
forest_plot(fit)

#######################
# logistic regression #
#######################
fit2 <- glm(caesarian ~ ., family = binomial, data = caesarian)
forest_plot(fit2)

Rkabacoff/qacReg documentation built on Aug. 1, 2022, 11:11 p.m.