if (FALSE) { # interactive()
if (.assert_package("emmeans", boolean = TRUE)) {
mod1 <- lm(Sepal.Length ~ Species, data = iris)
mod1 |>
tidy_and_attach() |>
tidy_add_pairwise_contrasts()
mod1 |>
tidy_and_attach() |>
tidy_add_pairwise_contrasts(pairwise_reverse = FALSE)
mod1 |>
tidy_and_attach() |>
tidy_add_pairwise_contrasts(keep_model_terms = TRUE)
mod1 |>
tidy_and_attach() |>
tidy_add_pairwise_contrasts(contrasts_adjust = "none")
if (.assert_package("gtsummary", boolean = TRUE)) {
mod2 <- glm(
response ~ age + trt + grade,
data = gtsummary::trial,
family = binomial
)
mod2 |>
tidy_and_attach(exponentiate = TRUE) |>
tidy_add_pairwise_contrasts()
}
}
}
Run the code above in your browser using DataLab