build_formula | R Documentation |
Build an expanded formula with poly and interaction terms
build_formula(formula, poly_terms = NULL, interaction_terms = NULL)
formula |
A base formula in the format Y ~ X | Z1 + Z2 |
poly_terms |
Character vector of polynomial term names |
interaction_terms |
Character vector of interaction term names |
A formula object combining all terms
poly_terms <- c("Z1_d_2", "Z2_d_2")
interaction_terms <- c("Z1_int_Z2")
formula <- Y ~ X | Z1 + Z2
final_formula <- build_formula(formula, poly_terms, interaction_terms)
print(final_formula)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.