
Fits the specified longitudinal model for the latent processes underlying the relevant time-varying covariates, up until the landmarking times
Source:R/landmarking_longitudinal.R
fit_longitudinal.Rd
Fits the specified longitudinal model for the latent processes underlying the relevant time-varying covariates, up until the landmarking times
Usage
fit_longitudinal(
x,
landmarks,
method,
formula,
dynamic_covariates,
cores = getOption("Ncpus", 1L),
...
)
Arguments
- x
An object of class
Landmarking
.- landmarks
A vector of Landmark times.
- method
Either "lcmm" or "lme4" or a function for fitting a longitudinal data model, where the first argument is a formula, and also has a
data
argument.- formula
A formula to be used in longitudinal sub-model fitting.
- dynamic_covariates
Vector of time-varying covariates to be modelled as the outcome of a longitudinal model.
- cores
Number of cores/threads to be used for parallel computation. Defaults to either
options("Ncpus")
if set, or 1 (single threaded) otherwise.- ...
Additional arguments passed to the longitudinal model fitting function (e.g. number of classes/clusters for lcmm).
Value
An object of class Landmarking
.
See also
lcmm::hlme()
and lme4::lmer()
for additional arguments.