plot_cap | R Documentation |
This function plots adjusted predictions (y-axis) against values of one or more predictors (x-axis and colors).
plot_cap( model, condition = NULL, type = "response", vcov = NULL, conf_level = 0.95, transform_post = NULL, draw = TRUE, ... )
model |
Model object |
condition |
character vector or named list of length smaller than 4. Character vectors must be the names of the predictor variables to display. The names of the list must The first element is displayed on the x-axis. The second element determines the colors. The third element creates facets. Other variables are held at their means or modes. Lists can include these types of values:
|
type |
string indicates the type (scale) of the predictions used to
compute marginal effects or contrasts. This can differ based on the model
type, but will typically be a string such as: "response", "link", "probs",
or "zero". When an unsupported string is entered, the model-specific list of
acceptable values is returned in an error message. When |
vcov |
Type of uncertainty estimates to report (e.g., for robust standard errors). Acceptable values:
|
conf_level |
numeric value between 0 and 1. Confidence level to use to build a confidence interval. |
transform_post |
(experimental) A function applied to unit-level adjusted predictions and confidence intervals just before the function returns results. For bayesian models, this function is applied to individual draws from the posterior distribution, before computing summaries. |
draw |
|
... |
Additional arguments are passed to the |
A ggplot2
object
Other plot:
plot.marginaleffects()
,
plot_cco()
,
plot_cme()
mod <- lm(mpg ~ hp + wt, data = mtcars) plot_cap(mod, condition = "wt") mod <- lm(mpg ~ hp * wt * am, data = mtcars) plot_cap(mod, condition = c("hp", "wt")) plot_cap(mod, condition = list("hp", wt = "threenum")) plot_cap(mod, condition = list("hp", wt = range))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.