Learn R Programming

latrend (version 1.6.1)

lcMethodFlexmix: Method interface to flexmix()

Description

Wrapper to the flexmix() method from the flexmix package.

Usage

lcMethodFlexmix(
  formula,
  formula.mb = ~1,
  time = getOption("latrend.time"),
  id = getOption("latrend.id"),
  nClusters = 2,
  ...
)

Arguments

formula

A formula specifying the model.

formula.mb

A formula specifying the class membership model. By default, an intercept-only model is used.

time

The name of the time variable.

id

The name of the trajectory identifier variable.

nClusters

The number of clusters to estimate.

...

Arguments passed to flexmix::flexmix. The following arguments are ignored: data, concomitant, k.

References

gruen2008flexmixlatrend

See Also

Other lcMethod package interfaces: lcMethodFlexmixGBTM

Examples

Run this code
data(latrendData)
if (require("flexmix")) {
  method <- lcMethodFlexmix(Y ~ Time, id = "Id", time = "Time", nClusters = 3)
  model <- latrend(method, latrendData)
}

Run the code above in your browser using DataLab