Summarize a comparisons object

# S3 method for comparisons
summary(object, conf_level = 0.95, transform_avg = NULL, ...)

Arguments

object

An object produced by the comparisons function

conf_level

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

transform_avg

(experimental) A function applied to the estimates and confidence intervals after the unit-level estimates have been averaged.

...

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 comparisons function

Examples

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

# average marginal effects
summary(con)
#>   Term    Contrast   Effect Std. Error z value   Pr(>|z|)    2.5 %   97.5 %
#> 1   hp (x + 1) - x -0.03533    0.01045 -3.3814 0.00072105 -0.05581 -0.01485
#> 2   wt (x + 1) - x -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