View source: R/marginal_tidiers.R
tidy_ggpredict | R Documentation |
ggeffects::ggpredict()
Use ggeffects::ggpredict()
to estimate marginal predictions
and return a tibble tidied in a way that it could be used by broom.helpers
functions.
See https://strengejacke.github.io/ggeffects/ for a list of supported
models.
tidy_ggpredict(x, conf.int = TRUE, conf.level = 0.95, ...)
x |
(a model object, e.g. |
conf.int |
( |
conf.level |
( |
... |
Additional parameters passed to |
By default, ggeffects::ggpredict()
estimate marginal predictions at the
observed mean of continuous variables and at the first modality of categorical
variables (regardless of the type of contrasts used in the model).
For more information, see vignette("marginal_tidiers", "broom.helpers")
.
By default, ggeffects::ggpredict()
estimates marginal predictions for each
individual variable, regardless of eventual interactions.
ggeffects::ggpredict()
Other marginal_tieders:
tidy_all_effects()
,
tidy_avg_comparisons()
,
tidy_avg_slopes()
,
tidy_marginal_contrasts()
,
tidy_marginal_means()
,
tidy_marginal_predictions()
,
tidy_margins()
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_ggpredict(mod)
tidy_plus_plus(mod, tidy_fun = tidy_ggpredict)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.