latrendBatch {latrend} | R Documentation |
Cluster longitudinal data for a list of method specifications
Description
Fit a list of longitudinal cluster methods on one or more datasets.
Usage
latrendBatch(
methods,
data,
cartesian = TRUE,
seed = NULL,
parallel = FALSE,
errorHandling = "stop",
envir = NULL,
verbose = getOption("latrend.verbose")
)
Arguments
methods |
A |
data |
The dataset(s) to which to fit the respective |
cartesian |
Whether to fit the provided methods on each of the datasets. If |
seed |
Sets the seed for generating a seed number for the methods.
Seeds are only set for methods without a seed argument or |
parallel |
Whether to enable parallel evaluation. See latrend-parallel. Method evaluation and dataset transformation is done on the calling thread. |
errorHandling |
Whether to |
envir |
The |
verbose |
The level of verbosity. Either an object of class |
Details
Methods and datasets are evaluated and validated prior to any fitting. This ensures that the batch estimation fails as early as possible in case of errors.
Value
A lcModels
object.
In case of a model fit error under errorHandling = pass
, a list
is returned.
See Also
lcMethods
Other longitudinal cluster fit functions:
latrend()
,
latrendBoot()
,
latrendCV()
,
latrendRep()
Examples
data(latrendData)
refMethod <- lcMethodLMKM(Y ~ Time, id = "Id", time = "Time")
methods <- lcMethods(refMethod, nClusters = 1:2)
models <- latrendBatch(methods, data = latrendData)
# different dataset per method
models <- latrendBatch(
methods,
data = .(
subset(latrendData, Time > .5),
subset(latrendData, Time < .5)
)
)