Summarize a marginaleffects object

# S3 method for marginaleffects
summary(object, conf_level = 0.95, ...)

Arguments

object

An object produced by the marginaleffects function

conf_level

numeric value between 0 and 1. Confidence level to use to build a confidence interval.

...

Additional arguments are passed to the predict() method supplied by the modeling package.These arguments are particularly useful for mixed-effects or bayesian models (see the online vignettes on the marginaleffects website). Available arguments can vary from model to model, depending on the range of supported arguments by each modeling package. See the "Model-Specific Arguments" section of the ?marginaleffects documentation for a non-exhaustive list of available arguments.

Value

Data frame of summary statistics for an object produced by the marginaleffects function

Examples

mod <- lm(mpg ~ hp * wt + factor(gear), data = mtcars)
mfx <- marginaleffects(mod)

# average marginal effects
summary(mfx)
#>   Term Contrast   Effect Std. Error z value   Pr(>|z|)    2.5 %   97.5 %
#> 1   hp    dY/dX -0.03533    0.01045 -3.3814 0.00072105 -0.05581 -0.01485
#> 2   wt    dY/dX -3.52593    0.73202 -4.8167 1.4593e-06 -4.96065 -2.09120
#> 3 gear    4 - 3  0.82900    1.11804  0.7415 0.45840435 -1.36232  3.02032
#> 4 gear    5 - 3  1.81650    1.54761  1.1737 0.24049622 -1.21675  4.84975
#> 
#> Model type:  lm 
#> Prediction type:  response