Learn R Programming

latrend (version 1.1.0)

latrend: Cluster longitudinal data

Description

Cluster longitudinal data

Usage

latrend(
  method,
  data,
  ...,
  envir = NULL,
  verbose = getOption("latrend.verbose")
)

Arguments

method

The lcMethod object specifying the longitudinal cluster method to apply.

data

The data.frame or matrix to which to apply the method.

...

Any other arguments to update the lcMethod definition with.

envir

The environment in which to evaluate the method arguments. Note that this only applies to data when data is a call.

verbose

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 Verbose), or one of c('info', 'fine', 'finest').

Value

A lcModel object representing the fitted model.

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 cluster preparation step.

See Also

Other longitudinal cluster fit functions: latrendBatch(), latrendBoot(), latrendCV(), latrendRep()

Examples

Run this code
# NOT RUN {
data(latrendData)
model <- latrend(lcMethodKML("Y", id = "Id", time = "Time"), data = latrendData)

method <- lcMethodKML("Y", id = "Id", time = "Time")
model <- latrend(method, data = latrendData, nClusters = 3)

model <- latrend(method, data = latrendData, nClusters = 3, seed = 1)
# }

Run the code above in your browser using DataLab