Learn R Programming

latrend (version 1.0.1)

lcMethodLcmmGMM: Specify GMM method using lcmm

Description

Growth mixture modeling through latent-class linear mixed modeling.

Usage

lcMethodLcmmGMM(
  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 + . + (Random1 + Random2 + . | Id). 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. The formula must contain a single random-effects component of the form (. | Id), where Id matches the name specified in the id argument, or ID (which will be substituted by the id argument). The random effects are cluster-specific.

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.

Details

The formula argument is used to generate the fixed, random, and mixture arguments for lcmm::hlme.

See Also

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

Examples

Run this code
# NOT RUN {
data(latrendData)
method <- lcMethodLcmmGMM(Y ~ Time * CLUSTER + (1 | Id),
                     id = "Id", time = "Time", , nClusters = 3)
gmm <- latrend(method, data = latrendData)
summary(gmm)

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

Run the code above in your browser using DataLab