View source: R/tidy_add_coefficients_type.R
tidy_add_coefficients_type | R Documentation |
Add the type of coefficients ("generic", "logistic", "poisson",
"relative_risk" or "prop_hazard") and the corresponding coefficient labels,
as attributes to x
(respectively
named coefficients_type
and coefficients_label
).
tidy_add_coefficients_type(
x,
exponentiate = attr(x, "exponentiate"),
model = tidy_get_model(x)
)
x |
( |
exponentiate |
( |
model |
(a model object, e.g. |
Other tidy_helpers:
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_disambiguate_terms()
,
tidy_identify_variables()
,
tidy_plus_plus()
,
tidy_remove_intercept()
,
tidy_select_variables()
ex1 <- lm(hp ~ mpg + factor(cyl), mtcars) |>
tidy_and_attach() |>
tidy_add_coefficients_type()
attr(ex1, "coefficients_type")
attr(ex1, "coefficients_label")
df <- Titanic |>
dplyr::as_tibble() |>
dplyr::mutate(Survived = factor(Survived, c("No", "Yes")))
ex2 <- glm(
Survived ~ Class + Age * Sex,
data = df,
weights = df$n,
family = binomial
) |>
tidy_and_attach(exponentiate = TRUE) |>
tidy_add_coefficients_type()
attr(ex2, "coefficients_type")
attr(ex2, "coefficients_label")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.