latrendRep {latrend} | R Documentation |
Cluster longitudinal data repeatedly
Description
Performs a repeated fit of the specified latrend model on the given data.
Usage
latrendRep(
method,
data,
.rep = 10,
...,
.errorHandling = "stop",
.seed = NULL,
.parallel = FALSE,
envir = NULL,
verbose = getOption("latrend.verbose")
)
Arguments
method |
An lcMethod object specifying the longitudinal cluster method to apply, or the name (as |
data |
The data of the trajectories to which to estimate the method for.
Any inputs supported by |
.rep |
The number of repeated fits. |
... |
Any other arguments to update the |
.errorHandling |
Whether to |
.seed |
Set the seed for generating the respective seed for each of the repeated fits. |
.parallel |
Whether to use parallel evaluation. See latrend-parallel. |
envir |
The |
verbose |
The level of verbosity. Either an object of class |
Details
This method is faster than repeatedly calling latrend as it only prepares the data via prepareData()
once.
Value
A lcModels
object containing the resulting models.
See Also
Other longitudinal cluster fit functions:
latrend()
,
latrendBatch()
,
latrendBoot()
,
latrendCV()
Examples
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)