| emm {ggeffects} | R Documentation |
emm() is a convenient shortcut to compute the estimated
marginal mean, resp. the marginal effect of the model's response
variable, with all independent variables held constant (at
their typical_value).
emm(model, ci.lvl = 0.95, type = c("fe", "re"), typical = "mean", ...)
model |
A fitted model object, or a list of model objects. Any model
that supports common methods like |
ci.lvl |
Numeric, the level of the confidence intervals. For |
type |
Character, only applies for mixed effects models. Indicates
whether predicted values should be conditioned on random effects
( |
typical |
Character vector, naming the function to be applied to the
covariates over which the effect is "averaged". The default is "mean".
See |
... |
Further arguments passed down to |
For linear models, the predicted value is the estimated marginal mean. Else, the predicted value is on the scale of the inverse of link function.
A tibble with the marginal effect of the response (predicted)
and the confidence intervals conf.low and conf.high.
For polr-objects, the marginal effect for each level of the
response variable is returned.
data(efc)
fit <- lm(barthtot ~ c12hour + neg_c_7 + c161sex + c172code, data = efc)
emm(fit)
# Example from ?MASS::polr
library(MASS)
options(contrasts = c("contr.treatment", "contr.poly"))
house.plr <- polr(Sat ~ Infl + Type + Cont, weights = Freq, data = housing)
emm(house.plr)