View source: R/formula-tools.R
enw_manual_formula | R Documentation |
For most typical use cases enw_formula()
should
provide sufficient flexibility to allow models to be defined. However,
there may be some instances where more manual model specification is
required. This function supports this by allowing the user to supply
vectors of fixed, random, and customised random effects (where they are
not first treated as fixed effect terms). Prior to 1.0.0
this was the
main interface for specifying models and it is still used internally to
handle some parts of the model specification process.
enw_manual_formula(
data,
fixed = NULL,
random = NULL,
custom_random = NULL,
no_contrasts = FALSE,
add_intercept = TRUE
)
data |
A |
fixed |
A character vector of fixed effects. |
random |
A character vector of random effects. Random effects specified here will be added to the fixed effects. |
custom_random |
A vector of random effects. Random effects added here will not be added to the vector of fixed effects. This can be used to random effects for fixed effects that only have a partial name match. |
no_contrasts |
Logical, defaults to |
add_intercept |
Logical, defaults to |
A list specifying the fixed effects (formula, design matrix, and design matrix index), and random effects (formula and design matrix).
Functions used to help convert formulas into model designs
as_string_formula()
,
construct_re()
,
construct_rw()
,
enw_formula()
,
parse_formula()
,
re()
,
remove_rw_terms()
,
rw()
,
rw_terms()
,
split_formula_to_terms()
data <- enw_example("prep")$metareference[[1]]
enw_manual_formula(data, fixed = "week", random = "day_of_week")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.