View source: R/leave_var_out_formulas.R
leave_var_out_formulas | R Documentation |
From an initial model formula, create a list of formulas that exclude each predictor.
leave_var_out_formulas(formula, data, full_model = TRUE, ...)
formula |
A model formula that contains at least two predictors. |
data |
A data frame. |
full_model |
A logical; should the list include the original formula? |
... |
Options to pass to |
The new formulas obey the hierarchy rule so that interactions without main effects are not included (unless the original formula contains such terms).
Factor predictors are left as-is (i.e., no indicator variables are created).
A named list of formulas
workflow_set()
data(penguins, package = "modeldata")
leave_var_out_formulas(
bill_length_mm ~ .,
data = penguins
)
leave_var_out_formulas(
bill_length_mm ~ (island + sex)^2 + flipper_length_mm,
data = penguins
)
leave_var_out_formulas(
bill_length_mm ~ (island + sex)^2 + flipper_length_mm +
I(flipper_length_mm^2),
data = penguins
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.