Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 ( 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:

lca<-read.table("", 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()),


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?

share|improve this question

Regarding question 2, another similar question here (Which R package to use to conduct a latent class growth analysis (LCGA) / growth mixture model (GMM)?) suggested OpenMx for "advanced structural equation modeling" in R. If it can be used to estimate growth mixture models, I'm betting it can be used to model a hybrid latent class/profile model. Haven't played with it myself yet though.

share|improve this answer
Thanks for the response. I looked at OpenMx but it seems to have a rather steep learning curve. I'll try to replicate the example with OpenMx when I get the time. Until then I think I will stick with depmixS4. – Erik J Apr 10 '13 at 14:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.