Performs a repeated fit of the specified latrend model on the given data.
latrendRep(
method,
data,
.rep = 10,
...,
.errorHandling = "stop",
.seed = NULL,
.parallel = FALSE,
envir = NULL,
verbose = getOption("latrend.verbose")
)An lcMethod object specifying the longitudinal cluster method to apply, or the name (as character) of the lcMethod subclass to instantiate.
The data of the trajectories to which to estimate the method for.
Any inputs supported by trajectories() can be used, including data.frame and matrix.
The number of repeated fits.
Any other arguments to update the lcMethod definition with.
Whether to "stop" on an error, or to "remove' evaluations that raised an error.
Set the seed for generating the respective seed for each of the repeated fits.
Whether to use parallel evaluation. See latrend-parallel.
The environment in which to evaluate the method arguments via compose().
If the data argument is of type call then this environment is also used to evaluate the data argument.
The level of verbosity. Either an object of class Verbose (see R.utils::Verbose for details),
a logical indicating whether to show basic computation information,
a numeric indicating the verbosity level (see R.utils::Verbose),
or one of c('info', 'fine', 'finest').
A lcModels object containing the resulting models.
This method is faster than repeatedly calling latrend as it only prepares the data via prepareData() once.
Other longitudinal cluster fit functions:
latrend(),
latrendBatch(),
latrendBoot(),
latrendCV()
data(latrendData)
method <- lcMethodLMKM(Y ~ Time, id = "Id", time = "Time")
models <- latrendRep(method, data = latrendData, .rep = 5) # 5 repeated runs
models <- latrendRep(method, data = latrendData, .seed = 1, .rep = 3)