plot.marginaleffects: Point-range plot of average marginal effects

Description Usage Arguments Details Value Examples

View source: R/plot.R

Description

Uses the ggplot2 package to draw a point-range plot of the average marginal effects computed by tidy.

Usage

1
2
## S3 method for class 'marginaleffects'
plot(x, conf.int = TRUE, conf.level = 0.95, ...)

Arguments

x

An object produced by the marginaleffects function.

conf.int

Logical indicating whether or not to include a confidence interval.

conf.level

The confidence level to use for the confidence interval if conf.int=TRUE. Must be strictly greater than 0 and less than 1. Defaults to 0.95, which corresponds to a 95 percent confidence interval.

...

Additional arguments are pushed forward to predict().

Details

The tidy function calculates average marginal effects by taking the mean of all the unit-level marginal effects computed by the marginaleffects function.

Value

A ggplot2 object

Examples

1
2
3
mod <- glm(am ~ hp + wt, data = mtcars)
mfx <- marginaleffects(mod)
plot(mfx)

marginaleffects documentation built on Oct. 19, 2021, 1:09 a.m.