I have question regarding which R-package to use to create a latent class/mixture model with both categorical and continuous indicator variables. I have not yet found a good example of this using R, even though there are a lot of mixture and latent class analysis packages in R. The software package Mplus have this capability and on the UCLA website there is an example of how to create such a model with Mplus (https://stats.idre.ucla.edu/mplus/seminars/intromplus-part2/mplus-class-notesanalyzing-data-latent-class-and-other-mixture-models/ the second example).
The only way I have been able to replicate this example in R is using the depmixS4 package. Using the following code:
library(depmixS4)
lca<-read.table("https://stats.idre.ucla.edu/wp-content/uploads/2016/02/lca.dat", sep=",")
names(lca)<-c( "hm", "he", "voc", "nocol" ,"ach9", "ach10", "ach11","ach12")
mod <- mix(list(hm~1,he~1,voc~1,nocol~1,ach9~1,ach10~1 ,ach11~1 ,ach12~1 ), data=lca, nstates=2,
family=list(multinomial(),multinomial(),multinomial(),multinomial(), gaussian(),gaussian(),gaussian(),gaussian()),
respstart=runif(32))
fmod<-fit(mod)
summary(fmod)
fmod@response
This code seems to do the job of replicating the example with some minor differences between the output in the depmixS4 variant and the Mplus.
First, is this code correct for reproducing the Mplus example?
Second, does anyone have any other packages they would recommend when creating this type of model in R?