data(latrendData)
if (rlang::is_installed("lcmm")) {
method <- lcMethodLcmmGMM(
fixed = Y ~ Time,
mixture = ~ Time,
random = ~ 1,
id = "Id",
time = "Time",
nClusters = 2
)
gmm <- latrend(method, data = latrendData)
summary(gmm)
# define method with gridsearch
method <- lcMethodLcmmGMM(
fixed = Y ~ Time,
mixture = ~ Time,
random = ~ 1,
id = "Id",
time = "Time",
nClusters = 3,
init = "gridsearch",
gridsearch.maxiter = 10,
gridsearch.rep = 50,
gridsearch.parallel = TRUE
)
}
Run the code above in your browser using DataLab