Learn R Programming

latrend (version 1.6.1)

lcMethodMixTVEM: Specify a MixTVEM

Description

Specify a MixTVEM

Usage

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

Arguments

formula

A formula excluding the time component. Time-invariant covariates are detected automatically as these are a special case in MixTVEM.

formula.mb

A formula for cluster-membership prediction. Covariates must be time-invariant. Furthermore, the formula must contain an intercept.

time

The name of the time variable.

id

The name of the trajectory identifier variable.

nClusters

The number of clusters. This replaces the numClasses argument of the TVEMMixNormal function call.

...

Arguments passed to the TVEMMixNormal() function. The following optional arguments are ignored: doPlot, getSEs, numClasses.

References

https://github.com/dziakj1/MixTVEM

dziak2015modelinglatrend

Examples

Run this code
# \donttest{
# this example only runs if you download and place MixTVEM.R in your wd
try({
  source("MixTVEM.R")
  method = lcMethodMixTVEM(
    Value ~ time(1) - 1,
    time = 'Assessment',
    id = "Id",
    nClusters = 3
  )
})
# }

Run the code above in your browser using DataLab