Solved – Latent class analysis order classes

clusteringlatent-classr

I am performing a latent class analysis with covariates. I want to calculate the predicted probabilities for the membership to different classes. However, if the order of the classes changes (as I rerun the model) I obtain different results for the predicted probability of the same class but in a different order. Does anyone encountered this problem before? I increased the number of maximum iterations in the model, but it does not seem to help. Also the classes' composition changes slightly when I rerun the model.

f  <- cbind(a1, a2, a3, a4) ~ sex + age + age_sq + inc 
lc <- poLCA(f, mydata, nclass=3, graphs=TRUE, maxiter=50000) 

where a1, a2, a3, a4 and inc varies between 1 and 4. This is the class composition, for example:

$a1
           Pr(1)  Pr(2)  Pr(3)  Pr(4)
class 1:   
class 2:
class 3:

$a2
....

Best Answer

What you're describing isn't a "problem" per se. Since the three latent classes are unordered, their labeling is completely arbitrary. In any particular run of the poLCA function, it's normal for the labels on the latent classes (1, 2, or 3) to switch around, as they simply depend on what random starting points the poLCA function's estimation algorithm happened to select. As long as each fit achieves the same maximum log-likelihood, the fitted models are all the same, regardless of how the class labels turn out.

For models with covariates, the label-switching will result in different coefficients on the predictor variables (although the class-conditional response probabilities will be the same). This is because the latent class that's used as the baseline for calculating the covariate effects changes. Again, though, the fit of the model is mathematically and substantively the same.

For more information on ordering latent classes, see section 5.6 of the poLCA user’s manual at http://dlinzer.github.io/poLCA/. This section also describes the use of the poLCA.reorder() function for manually reordering the latent classes in your model. If you are primarily interested in each observation's posterior class membership probabilities, see section 5.3 of the user's manual and the posterior element of the estimated poLCA model object.