Skip to contents

This function removes random walk terms denoted using rw() from a formula so that they can be processed on their own.

Usage

remove_rw_terms(formula)

Arguments

formula

A model formula that may use standard fixed effects, random effects using lme4 syntax (see re()), and random walks defined using the rw() helper function. See the Details section below for a comprehensive explanation of the supported syntax.

Value

A formula object with the random walk terms removed.

Reference

This function was adapted from code written by J Scott (under an MIT license) as part of the epidemia package (https://github.com/ImperialCollegeLondon/epidemia/).

Examples

epinowcast:::remove_rw_terms(~ 1 + age_group + location)
#> ~1 + age_group + location
#> <environment: 0x55a5033eec40>

epinowcast:::remove_rw_terms(~ 1 + age_group + location + rw(week, location))
#> ~1 + age_group + location
#> <environment: 0x55a50353e5c8>