plot_cap {marginaleffects} | R Documentation |
plot_predictions()
is an alias to plot_predictions()
This alias is kept for backward compatibility.
plot_cap(
model,
condition = NULL,
by = NULL,
type = NULL,
vcov = NULL,
conf_level = 0.95,
transform_post = NULL,
points = 0,
rug = FALSE,
gray = FALSE,
draw = TRUE,
...
)
model |
Model object |
condition |
Conditional predictions
|
by |
Marginal predictions
|
type |
string indicates the type (scale) of the predictions used to
compute contrasts or slopes. 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 |
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. |
points |
Number between 0 and 1 which controls the transparency of raw data points. 0 (default) does not display any points. |
rug |
TRUE displays tick marks on the axes to mark the distribution of raw data. |
gray |
FALSE grayscale or color plot |
draw |
|
... |
Additional arguments are passed to the |
A ggplot2
object or data frame (if draw=FALSE
)
mod <- lm(mpg ~ hp + wt, data = mtcars)
plot_predictions(mod, condition = "wt")
mod <- lm(mpg ~ hp * wt * am, data = mtcars)
plot_predictions(mod, condition = c("hp", "wt"))
plot_predictions(mod, condition = list("hp", wt = "threenum"))
plot_predictions(mod, condition = list("hp", wt = range))