I'm trying to perform a growth mixture modelling (GMM) analysis in R using the lcmm
package. I have a dataset with several items from psychological scales - and a subject ID column - and I want to perform a GMM for each scale.
For example, one scale is composed of Item1
, Item2
and Item3
. So I'm using the following code:
set.seed(1000)
gmm_IWBgen_1 <- multlcmm(Item1 + Item2 + Item3 ~ Time, subject = "ID", random=~1 + Time, ng = 1, data = GMM_data)
gmm_IWBgen_2 <- gridsearch(rep = 100, maxiter = 10, minit = gmm_IWBgen_1, multlcmm(Item1 + Item2 + Item3 ~ Time, subject = "ID", random=~1 + Time, ng = 2, data = GMM_data, mixture = ~ Time, nwg=T))
gmm_IWBgen_3 <- gridsearch(rep = 100, maxiter = 10, minit = gmm_IWBgen_1, multlcmm(Item1 + Item2 + Item3 ~ Time, subject = "ID", random=~1 + Time, ng = 3, data = GMM_data, mixture = ~ Time, nwg=T))
However, the following error arises:
Error in order(IND): unimplemented type 'list' in 'orderVector1'
Traceback:
1. multlcmm(Item1 + Item2 + Item3 ~ Time, subject = "ID", random = ~1 +
. Time, ng = 1, data = GMM_data)
2. order(IND)
Anyone knows which is the problem and how to solve it?
Thanks in advance!
(By the way, I'm using the Colab R kernel.)