Skip to contents

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 in dh.lmeMultPoly.

id_var

Character specifying the name of the column which uniquely identifies each subject within data frame to be specified in df argument in dh.lmeMultPoly.

age_vars

Character vector specifying names of age polynomials present in data frame specified in df argument in dh.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 with age 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()