latrend {latrend} | R Documentation |
Cluster longitudinal data using the specified method
Description
An overview of the latrend package and its capabilities can be found here.
The latrend()
function fits a specified longitudinal cluster method to the given data comprising the trajectories.
This function runs all steps of the standardized method estimation procedure, as implemented by the given lcMethod
object.
The result of this procedure is the estimated lcModel.
Usage
latrend(
method,
data,
...,
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 |
... |
Any other arguments to update the |
envir |
The |
verbose |
The level of verbosity. Either an object of class |
Details
If a seed value is specified in the lcMethod
object or arguments to latrend
, this seed is set using set.seed
prior to the preFit step.
Value
A lcModel object representing the fitted solution.
See Also
Other longitudinal cluster fit functions:
latrendBatch()
,
latrendBoot()
,
latrendCV()
,
latrendRep()
Examples
data(latrendData)
method <- lcMethodLMKM(Y ~ Time, id = "Id", time = "Time")
model <- latrend(method, data = latrendData)
model <- latrend("lcMethodLMKM", formula = Y ~ Time, id = "Id", time = "Time", data = latrendData)
model <- latrend(method, data = latrendData, nClusters = 3, seed = 1)