Closed LauraSirucek closed 2 months ago
Hi Laura,
it is not a problem that the model converged in 1 iteration. It corresponds to the number of iterations after the 15 iterations (because you specified maxiter = 15) you did as a first step in the gridsearch.
Viviane
Dear Cécile,
I am using your lcmm package and the function hlme() to identify latent classes in how "ppt" (pressure pain thresholds; a measure of pain sensitivity) changes over time/in response to an intervention (categorical variable; "before"/"during"/"after" the intervention) in a sample of patients with chronic pain and pain-free volunteers (id_num).
As instructed in your paper, I first ran a 1-Class model. In this model, gender turned out to be a significant predictor of ppt, thus we also included it in the baseline model. I then ran a 2-Class model with the initial parameter values from the 1-Class model as starting point. After that, I wanted to try the gridsearch() option because trying multiple random vectors of initial values made sense to me.
Now, what surprised me is, that the 2-Class model with the initial parameter values from the 1-Class model converged after 11 iterations, while the gridsearch() approach converged after only one iteration. I also ran a 3-Class and a 4-Class model and, to better understand the LCMM approach, with different "rep" and "maxiter" values. Surprisingly, all gridsearch() approaches resulted in number of iteration = 1 for almost all models (while the respective models without gridsearch() all converged after a higher number of iterations).
Thus, my questions are:
Here is my code and the results displaying the number of iterations:
1-Class Model:
Result:
2-Class Model - Without gridsearch:
Result:
2-Class Model - With gridsearch:
Result:
Thank you very much in advance for your help with this issue and kind regards, Laura