Make formulae for fitting multiple fractional polynomial models
Source:R/make-lmer-form.R
dh.makeLmerForm.Rd
This function is designed to be used with dh.lmeMultPoly
. It generates
formulae for multiple fractional polynomial models which can be used as
input to the formulae
argument in dh.lmeMultPoly
.
Usage
dh.makeLmerForm(
outcome = NULL,
id_var = NULL,
age_vars = NULL,
random = NULL,
fixed = NULL,
age_interactions = NULL
)
Arguments
- outcome
Character specifying the name of outcome variable within data frame to be specified in
df
argument indh.lmeMultPoly
.- id_var
Character specifying the name of the column which uniquely identifies each subject within data frame to be specified in
df
argument indh.lmeMultPoly
.- age_vars
Character vector specifying names of age polynomials present in data frame specified in
df
argument indh.lmeMultPoly
.- random
Specifies random effects to include in formulae. Use either "intercept" for random intercept model or "slope" for random slope model.
- fixed
Optionally, character vector specifying fixed effects to be included in model. If no argument is provided default is to create formula only including outcome, age terms and random effects.
- age_interactions
Optionally, character vector specifying variable provided to
fixed
for which to create interactions withage vars
. If no argument is provided default is to create formula with no interaction terms.
Value
Tibble containing two columns:
polys = Transformations of
age_var
formula = Formula to be used as input to ds.lmerSLMA or dh.lmeMultPoly.
See also
Other trajectory functions:
dh.lmeMultPoly()
,
dh.makeAgePolys()
,
dh.predictLmer()
,
dh.trimPredData()
,
dh.zByGroup()