# NOT RUN {
# The output only has 2 rows, and all the variables except `hp` are at their
# mean or mode.
typical(data = mtcars, hp = c(100, 110))
# We get the same result by feeding a model instead of a data.frame
mod <- lm(mpg ~ hp, mtcars)
typical(model = mod, hp = c(100, 110))
# Use in `marginaleffects` to compute "Typical Marginal Effects"
marginaleffects(mod, newdata = typical(hp = c(100, 110)))
# }
Run the code above in your browser using DataLab