Bayesian Latent Profile Analysis; Nee... PreviousNext
Mplus Discussion > Latent Variable Mixture Modeling >
 S.Arunachalam posted on Sunday, September 27, 2015 - 6:24 am
Respected Prof. Muthen.

I doing a LPA with one continuous variable X1. I need the class assignments and CPROBs for each record. I am able to get this using esti=mlr. But in esti=bayes am getting the below error.

*** WARNING in SAVEDATA command
Class probabilities cannot be saved for ESTIMATOR=BAYES.

I tried a work-around of using save=fscores(10) and I get class proportions instead of cprob.
------ ---- ----
+C F10.3
C Proportion for Class 1 F10.3
C Proportion for Class 2 F10.3
C Proportion for Class 3 F10.3

+ variables that have a value for each of the 10 imputations
---- ------ -----
Is the C proportion same as CPROB please? Also I need the class assignments as well. Please advice.
The reason I need class assignments and CPROB is to calculate the predicted value of my variable X1.
 Bengt O. Muthen posted on Sunday, September 27, 2015 - 6:33 pm
Send the Bayes output, saved data, and license number to Support.
 S.Arunachalam posted on Monday, September 28, 2015 - 12:38 am
Dear Prof. Muthen.
Thank you. I have sent you an email as advised.
 Guido Biele posted on Tuesday, November 21, 2017 - 1:19 am

I would like to save or calculate class probabilities for each iteration in the context of a Bayesian mixture CFA/latent profile analysis.

It appears that save=fscores(10) will generate a sample of 10 class memberships using the posterior distribution. Could I exploit the fscores command to generate class memberships for each iteration by setting save=fscores(BITERATIONS) [not literally, just the number I set BITERATIONS to) to get group memberships for each iteration? If yes, would the 1st column of class member ships be calculated from the 1st iteration of the posterior, the 2nd class memberships from the second iteration, etc?

Also, could you point me to a paper where I could read up how to calculate class probabilities for each iteration given the model parameters?

I would like to use class probabilities to deal with label switching, and a number of label switching algorithms are based on class probabilities (

Thanks in advance, Guido
 Tihomir Asparouhov posted on Tuesday, November 21, 2017 - 4:01 pm
We recommend using model constraints to deal with label switching if it occurs or to simplify the model so it doesn't occur.

Using the command
savedata: file is 1.dat; save=fs(1000);
you get (see SAVEDATA INFORMATION at the end of the output file)

+C F10.3
C Proportion for Class 1 F10.3
C Proportion for Class 2 F10.3

"+C" is the 1000 columns imputed values for C
"C Proportion for Class i" is the last two columns with the posterior class probabilities for each individual.

To see the posterior probability computation see Section 8.1 in
 Guido Biele posted on Wednesday, November 22, 2017 - 12:02 am

I tried using constraints, but got the error Messages "UNABLE TO GENERATE PARAMETERS SATISFYING THE CONSTRAINTS.".

Here is the relevant section of the Bayesian mixture CFA model with 4 latent groups:

! Bayesian CFA model with N(0,.01) priors for cross loadings
[F1*-2.5] (m1);
[F1*-1.5] (m2);
[F1*-0.5] (m3);
m3 < 0; ! factor mean of the last group is fixed at zero
m2 < m3;
m1 < m2;

Can you spot an error in this code?

What I have done now is that I specified priors with different means for the means of the first factor:


which of course means that label switching can occur...
 Tihomir Asparouhov posted on Wednesday, November 22, 2017 - 10:47 am
The constrain will work if the posteriors for m1,m2,m3 don't overlap much. If they do it won't work, so one would pick another set of constraints such as the mean for another factor that is more discriminating.

Label switching can occur but it doesn't occur often at all in my experience unless there is not a lot of information in the data about the latent classes. Using the tracelines it is very easy to spot label switching. I wouldn't worry about label switching unless it actually occurs. The model prior is a good idea as well. Also using ML estimator in parallel to the bayes estimation can be used as guidance for model constraint parameters.
Back to top
Add Your Message Here
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Options: Enable HTML code in message
Automatically activate URLs in message