Learn R Programming

latrend (version 1.0.1)

lcMethodLcmmGBTM: Specify GBTM method

Description

Group-based trajectory modeling through fixed-effects modeling.

Usage

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

Arguments

formula

A formula of the form Response ~ Var1 + CLUSTER * Var2 + . Variables specified in the model are included as fixed effects. If an interaction is specified with the CLUSTER term then these covariates are included as fixed and mixture effects.

formula.mb

A formula specifying the class membership model. By default, an intercept-only model is used. This is a replacement of the internal classmb argument in lcmm::hlme.

time

The name of the time variable.

id

The name of the trajectory identifier variable. This replaces the subject argument of lcmm::hlme.

nClusters

The number of clusters to fit. This replaces the ng argument of lcmm::hlme.

...

Arguments passed to lcmm::hlme. The following arguments are ignored: data, fixed, random, mixture, subject, classmb, returndata, ng, verbose, subset.

See Also

Other lcMethod implementations: lcMethod-class, lcMethodAKMedoids, lcMethodCrimCV, lcMethodCustom, lcMethodDtwclust, lcMethodFunFEM, lcMethodGCKM, lcMethodKML, lcMethodLMKM, lcMethodLcmmGMM, lcMethodLongclust, lcMethodMclustLLPA, lcMethodMixAK_GLMM, lcMethodMixtoolsGMM, lcMethodMixtoolsNPRM, lcMethodRandom, lcMethodStratify, lcMethodTwoStep

Examples

Run this code
# NOT RUN {
data(latrendData)
method <- lcMethodLcmmGBTM(Y ~ CLUSTER, id = "Id", time = "Time", nClusters = 3)
gbtm <- latrend(method, data = latrendData)
summary(gbtm)

method <- lcMethodLcmmGBTM(Y ~ CLUSTER * Time, id = "Id", time = "Time", nClusters = 3)
# }

Run the code above in your browser using DataLab