CecileProust-Lima / lcmm

R package lcmm
https://CecileProust-Lima.github.io/lcmm/
58 stars 13 forks source link

plot latent class trajectories for ordinal data #249

Closed cdriesse closed 4 months ago

cdriesse commented 7 months ago

I am trying to use lcmm package for LCGA with ordinal and binary data. For starting values I am refering the the 1 class model I am now trying to create plots but have been unable to figure out how to create these plots or at least would like to create a plot of the best fitting model. I am unable to find any guidance on plots created with lcmm for the threshold function. Can somebody please provide guidance. Coding for my models is as follow:

lcga1_COMP <- lcmm(GHQ2 ~ age2, subject = "id", ng = 1, data = completelong, link = 'thresholds') lcga2_COMP <- gridsearch(rep = 100, maxiter = 10, minit = lcga1_COMP, m=lcmm(GHQ2 ~ age2, subject = "id", ng = 2, data = completelong, link = 'thresholds', mixture = ~ age2)) lcga3_COMP <- gridsearch(rep = 100, maxiter = 10, minit = lcga1_COMP, m=lcmm(GHQ2 ~ age2, subject = "id", ng = 3, data = completelong, link = 'thresholds', mixture = ~ age2)) lcga4_COMP <- gridsearch(rep = 100, maxiter = 10, minit = lcga1_COMP, m=lcmm(GHQ2 ~ age2, subject = "id", ng = 4, data = completelong, link = 'thresholds', mixture = ~ age2))

VivianePhilipps commented 6 months ago

Hi,

the function you are looking for is predictL. There is an example here : https://cecileproust-lima.github.io/lcmm/articles/latent_process_model_with_multlcmm_IRT.html This is for a multlcmm model, but it works exaclty the same with lcmm.

Viviane