data(latrendData)
method <- lcMethodLMKM(Y ~ Time, id = "Id", time = "Time")
model <- latrend(method, latrendData)
postprob(model)
if (rlang::is_installed("lcmm")) {
gmmMethod = lcMethodLcmmGMM(
fixed = Y ~ Time,
mixture = ~ Time,
id = "Id",
time = "Time",
idiag = TRUE,
nClusters = 2
)
gmmModel <- latrend(gmmMethod, data = latrendData)
postprob(gmmModel)
}
Run the code above in your browser using DataLab