parse_formula | R Documentation |
This function uses a series internal functions
to break an input formula into its component parts each of which
can then be handled separately. Currently supported components are
fixed effects, lme4 style random effects, and random walks using the
rw()
helper function.
parse_formula(formula)
formula |
A model formula that may use standard fixed
effects, random effects using lme4 syntax (see |
A list of formula components. These currently include:
fixed
: A character vector of fixed effect terms
random
: A list of of lme4 style random effects
rw
: A character vector of rw()
random walk terms.
The random walk functions used internally by this function were
adapted from code written by J Scott (under an MIT license) as part of
the epidemia
package (https://github.com/ImperialCollegeLondon/epidemia/).
Functions used to help convert formulas into model designs
as_string_formula()
,
construct_re()
,
construct_rw()
,
enw_formula()
,
enw_manual_formula()
,
re()
,
remove_rw_terms()
,
rw()
,
rw_terms()
,
split_formula_to_terms()
epinowcast:::parse_formula(~ 1 + age_group + location)
epinowcast:::parse_formula(~ 1 + age_group + (1 | location))
epinowcast:::parse_formula(~ 1 + (age_group | location))
epinowcast:::parse_formula(~ 1 + (1 | location) + rw(week, location))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.