CecileProust-Lima / lcmm

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

Issue with multlcmm #224

Closed esmeraldaderubi closed 6 months ago

esmeraldaderubi commented 8 months ago

Hello all,

I am new in R and this library. I want to use multlcmm for unsupervised clusters for trajectories. But I get an error I do not understand " Please specify initial values with argument 'B' when B is optional in the manual

ls(data) [1] "Conduct" "Emotion" "Hyper" "Peer" "Prosoc" "recodedID" [7] "Time"

Thanks

library(lcmm)

#load data
data <- read.csv(file = 'TableSweep_unsupervised.csv')
ls(data)
### Estimation of mixed-effect models and latent class mixed-effect models for multiple longitudinal markers measuring the same underlying latent process ### 
m1_mult_lin <- multlcmm(Emotion+Conduct +Hyper+ Peer+ Prosoc ~ Time , random =~ Time , subject= 'recodedID', data = data,  mixture =~ Time, ng = 3, cor = BM(Time))
summary(m1_mult_lin)
VivianePhilipps commented 7 months ago

Hi,

B is optional only for one class models (ng=1). Otherwise, you should specify initial values, for example by providing the one class model. Details are given in this page : https://cecileproust-lima.github.io/lcmm/articles/latent_class_model_with_hlme.html The example uses hlme, but it works in the same way with multlcmm.

Viviane