View source: R/tidy_disambiguate_terms.R
| tidy_disambiguate_terms | R Documentation |
For mixed models, the term column returned by broom.mixed may have
duplicated values for random-effect parameters and random-effect values.
In such case, the terms could be disambiguated be prefixing them with the
value of the group column. tidy_disambiguate_terms() will not change
any term if there is no group column in x. The original term value
is kept in a new column original_term.
tidy_disambiguate_terms(x, sep = ".", model = tidy_get_model(x), quiet = FALSE)
x |
( |
sep |
( |
model |
(a model object, e.g. |
quiet |
( |
Other tidy_helpers:
tidy_add_coefficients_type(),
tidy_add_contrasts(),
tidy_add_estimate_to_reference_rows(),
tidy_add_header_rows(),
tidy_add_n(),
tidy_add_pairwise_contrasts(),
tidy_add_reference_rows(),
tidy_add_term_labels(),
tidy_add_variable_labels(),
tidy_attach_model(),
tidy_group_by(),
tidy_identify_variables(),
tidy_plus_plus(),
tidy_remove_intercept(),
tidy_select_variables()
if (
.assert_package("lme4", boolean = TRUE) &&
.assert_package("broom.mixed", boolean = TRUE) &&
.assert_package("gtsummary", boolean = TRUE)
) {
mod <- lme4::lmer(marker ~ stage + (1 | grade) + (death | response), gtsummary::trial)
mod |>
tidy_and_attach() |>
tidy_disambiguate_terms()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.