forest_plot | R Documentation |
Display a forest plot of regression parameters for a
given "lm"
or "glm"
model.
forest_plot(x, digits = 2, ci = 0.95)
x |
object of class "lm" or "glm" |
digits |
number of decimal digits to display |
ci |
confidence level (default = 0.95) |
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.
a ggplot2 graph
info.lm
, info.glm
####################### # multiple regression # ####################### fit <- lm(mpg ~ ., data = auto_mpg) forest_plot(fit) ####################### # logistic regression # ####################### fit2 <- glm(caesarian ~ ., family = binomial, data = caesarian) forest_plot(fit2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.