if (FALSE) { # interactive()
# Average Marginal Means
df <- Titanic |>
dplyr::as_tibble() |>
tidyr::uncount(n) |>
dplyr::mutate(Survived = factor(Survived, c("No", "Yes")))
mod <- glm(
Survived ~ Class + Age + Sex,
data = df, family = binomial
)
tidy_marginal_means(mod)
tidy_plus_plus(mod, tidy_fun = tidy_marginal_means)
mod2 <- lm(Petal.Length ~ poly(Petal.Width, 2) + Species, data = iris)
tidy_marginal_means(mod2)
}
Run the code above in your browser using DataLab