tidy_remove_intercept: Remove intercept(s)

View source: R/tidy_remove_intercept.R

tidy_remove_interceptR Documentation

Remove intercept(s)

Description

Will remove terms where var_type == "intercept".

Usage

tidy_remove_intercept(x, model = tidy_get_model(x))

Arguments

x

(data.frame)
A tidy tibble as produced by ⁠tidy_*()⁠ functions.

model

(a model object, e.g. glm)
The corresponding model, if not attached to x.

Details

If the variable column is not yet available in x, tidy_identify_variables() will be automatically applied.

See Also

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_disambiguate_terms(), tidy_identify_variables(), tidy_plus_plus(), tidy_select_variables()

Examples

df <- Titanic |>
  dplyr::as_tibble() |>
  dplyr::mutate(Survived = factor(Survived))
glm(Survived ~ Class + Age + Sex, data = df, weights = df$n, family = binomial) |>
  tidy_and_attach() |>
  tidy_remove_intercept()

broom.helpers documentation built on Sept. 11, 2024, 6:31 p.m.