Skip to contents

It is computed with emmeans::emmeans().

Usage

model_get_pairwise_contrasts(
  model,
  variables,
  pairwise_reverse = TRUE,
  contrasts_adjust = NULL,
  conf.level = 0.95,
  emmeans_args = list()
)

Arguments

model

(a model object, e.g. glm)
A model object.

variables

(tidy-select)
Variables to add pairwise contrasts.

pairwise_reverse

(logical)
Determines whether to use "pairwise" (if TRUE) or "revpairwise" (if FALSE), see emmeans::contrast().

contrasts_adjust

optional adjustment method when computing contrasts, see emmeans::contrast() (if NULL, use emmeans default)

conf.level

(numeric)
Level of confidence for confidence intervals (default: 95%).

emmeans_args

(logical)
List of additional parameter to pass to emmeans::emmeans() when computing pairwise contrasts.

Details

[Experimental] For pscl::zeroinfl() and pscl::hurdle() models, pairwise contrasts are computed separately for each component, using mode = "count" and mode = "zero" (see documentation of emmeans) and a component column is added to the results. This support is still experimental.

Examples

if (FALSE) { # interactive()
if (.assert_package("emmeans", boolean = TRUE)) {
  mod <- lm(Sepal.Length ~ Species, data = iris)
  mod |> model_get_pairwise_contrasts(variables = "Species")
  mod |>
    model_get_pairwise_contrasts(
      variables = "Species",
      contrasts_adjust = "none"
    )
}
}