add_term | R Documentation |
Add or remove terms to a lmer formula string
add_term(x, fixed = NULL, random = NULL, drop = NULL, drop.random = NULL, ...)
x |
Either mer formula object, string containing formula, lmer object. If latter is the case, the updated object will be returned instead of a new formula. |
fixed |
List of character strings containing variable names or terms to include in the formula as fixed terms. |
random |
List of character strings containing variable names or terms to include in the formula as random terms. |
drop |
List of character strings containing variable names or fixed terms to exclude from the formula. |
drop.random |
List of character strings containing variable names or random terms to exclude from the formula. |
... |
Extra arguments passed to 'update'. Works only if 'x' is a lmer object. |
f1 <- "a ~ b + c + (1| group)"
add_term(f1, , "Conservation")
add_term(f1, "Conservation*GDP")
add_term(f1, "Conservation*GDP", "Conservation")
add_term(f1, drop="female", drop.random = "g.agea")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.