View source: R/get_marginaleffects.R
get_marginaleffects | R Documentation |
Modelbased-like API to create marginaleffects objects. This is Work-in-progress.
get_marginaleffects(model, trend = NULL, at = NULL, fixed = NULL, ...)
model |
A statistical model. |
trend |
A character indicating the name of the variable for which to compute the slopes. |
at |
The predictor variable(s) at which to evaluate the desired effect / mean / contrasts. Other predictors of the model that are not included here will be collapsed and "averaged" over (the effect will be estimated across them). |
fixed |
A character vector indicating the names of the predictors to be "fixed" (i.e., maintained), so that the estimation is made at these values. |
... |
Other arguments passed for instance to |
if (require("marginaleffects")) { model <- lm(Sepal.Width ~ Species * Petal.Length, data = iris) get_marginaleffects(model, trend = "Petal.Length", at = "Species") get_marginaleffects(model, trend = "Petal.Length", at = "Petal.Length") get_marginaleffects(model, trend = "Petal.Length", at = c("Species", "Petal.Length")) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.