latrend | R Documentation |
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.
latrend(
method,
data,
...,
envir = NULL,
verbose = getOption("latrend.verbose")
)
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 |
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.
A lcModel object representing the fitted solution.
Other longitudinal cluster fit functions:
latrendBatch()
,
latrendBoot()
,
latrendCV()
,
latrendRep()
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.