R/methodGCKM.R
lcMethodGCKM.RdTwo-step clustering through latent growth curve modeling and k-means.
Formula, including a random effects component for the trajectory. See lme4::lmer formula syntax.
The name of the time variable..
The name of the trajectory identifier variable.
The number of clusters.
A function that computes the cluster center based on the original trajectories associated with the respective cluster.
By default, the mean is computed.
A function to standardize the output matrix of the representation step. By default, the output is shifted and rescaled to ensure zero mean and unit variance.
Arguments passed to lme4::lmer. The following external arguments are ignored: data, centers, trace.
Other lcMethod implementations:
getArgumentDefaults(),
getArgumentExclusions(),
lcMethod-class,
lcMethodAkmedoids,
lcMethodCrimCV,
lcMethodDtwclust,
lcMethodFeature,
lcMethodFunFEM,
lcMethodFunction,
lcMethodKML,
lcMethodLMKM,
lcMethodLcmmGBTM,
lcMethodLcmmGMM,
lcMethodMclustLLPA,
lcMethodMixAK_GLMM,
lcMethodMixtoolsGMM,
lcMethodMixtoolsNPRM,
lcMethodRandom,
lcMethodStratify
data(latrendData)
if (require("lme4")) {
method <- lcMethodGCKM(Y ~ (Time | Id), id = "Id", time = "Time", nClusters = 3)
model <- latrend(method, latrendData)
}
#> Loading required package: lme4
#> Loading required package: Matrix
#>
#> Attaching package: ‘lme4’
#> The following objects are masked from ‘package:reformulas’:
#>
#> expandDoubleVerts, findbars, formatVC, isNested, mkReTrms, nobars,
#> subbars
#> The following object is masked from ‘package:flexmix’:
#>
#> refit