| ggalleffects {ggeffects} | R Documentation |
ggalleffects() computes marginal effects of model terms.
It internally calls allEffects and
puts the result into tidy data frames.
ggalleffects(model, terms = NULL, ci.lvl = 0.95, ...)
model |
A fitted model object, or a list of model objects. Any model that is supported by the effects-package should work. |
terms |
Character vector with term names of selected variables from
|
ci.lvl |
Numeric, the level of the confidence intervals. For |
... |
Further arguments passed down to |
A list of tibbles (with ggeffects class attribute) with consistent
data columns. The list contains one tibble per model term. Columns are:
xthe values of the model predictor to which the effect pertains, used as x-position in plots.
predictedthe predicted values, used as y-position in plots.
conf.lowthe lower bound of the confidence interval for the predicted values.
conf.highthe upper bound of the confidence interval for the predicted values.
Interaction effects are not included in the return value, i.e. ggalleffects()
does not compute marginal effects for interaction terms. Use gginteraction
to create tidy data frames especially for interaction terms.
data(efc) fit <- lm(barthtot ~ c12hour + neg_c_7 + c161sex + c172code, data = efc) ggalleffects(fit) library(ggplot2) fit <- lm(barthtot ~ c12hour + neg_c_7 + c160age, data = efc) mydf <- get_complete_df(ggalleffects(fit)) ggplot(mydf, aes(x, predicted)) + geom_line() + facet_wrap(~group, scale = "free_x", ncol = 1)