Skip to contents

Thin extender over emmeans::emmeans(). The fitted model is passed through unchanged; specs follows the usual emmeans formula / list interface. Use emmeans::pairs() or emmeans::contrast() on the returned object for pairwise or custom contrasts.

Usage

morie_effects_emmeans(model, specs, ...)

Arguments

model

A fitted model object (lm, glm, lmerMod, ...).

specs

Specification for the marginal means – a formula (e.g. ~ treatment), character vector of factor names, or a list, exactly as accepted by emmeans::emmeans().

...

Further arguments forwarded to emmeans::emmeans().

Value

An emmGrid object.

Examples

if (requireNamespace("emmeans", quietly = TRUE)) {
  set.seed(1)
  df <- data.frame(y = rnorm(60), x = rnorm(60), g = factor(rep(c("a", "b"), 30)))
  fit <- stats::lm(y ~ x + g, data = df)
  morie_effects_emmeans(fit, specs = "g")
}
#>  g  emmean    SE df lower.CL upper.CL
#>  a  0.2412 0.157 57  -0.0728    0.555
#>  b -0.0259 0.157 57  -0.3399    0.288
#> 
#> Confidence level used: 0.95