Learn R Programming

marginaleffects (version 0.3.4)

tidy.predictions: Tidy a predictions object

Description

Calculate average adjusted predictions by taking the mean of all the unit-level adjusted predictions computed by the predictions function.

Usage

# S3 method for predictions
tidy(x, ...)

Arguments

x

An object produced by the predictions function.

...

The "Model-Specific Arguments" section below gives a list of arguments which can modify the behavior of this function for certain models (e.g., mixed-effects or bayesian).

Value

A "tidy" data.frame of summary statistics which conforms to the broom package specification.

Examples

Run this code
# NOT RUN {
mod <- lm(mpg ~ hp * wt + factor(gear), data = mtcars)
mfx <- predictions(mod)
tidy(mfx)
# }

Run the code above in your browser using DataLab