Latent Class and Latent Profile Analysis

Deciding how many classes a latent class or latent profile model needs is done by comparing a series of fitted models, and the comparison rests in part on quantities built from the fit of the whole series. This page reads the output files of the whole series at once and assembles the enumeration table: the information criteria of every model in the series, the Bayes factor between adjacent models and the BIC-based relative probability of each model within the fitted candidate set, the classification diagnostics, and the homogeneity and separation of the classes of the model that is being considered.

What to request from Mplus. Fit the models from one class upward, each in its own run, and add OUTPUT: TECH11 TECH14; so that the two likelihood ratio tests are printed. For a latent class analysis of categorical indicators the item probabilities are printed on their own; for a latent profile analysis of continuous indicators the class means are in MODEL RESULTS. Nothing else is needed: every number this page uses is in the files. A warning printed by Mplus is counted and reported; it does not remove a model from the table. What does remove it is a loglikelihood that was not replicated or a run that did not terminate normally.

What to do

  1. Run the series of models, one file per number of classes.
  2. Drop all the .out files on the box below at once, or choose them together. The number of classes is read from each file, so the order in which they arrive does not matter.
  3. Read the enumeration table, then open the model you are considering to see its class sizes, its classification and the homogeneity and separation of its classes.
Drop the Mplus .out files here, or press Enter to choose them.

The files are read in your browser and are not sent anywhere. Several files can be added in more than one go; a file that is dropped twice replaces the earlier copy.

The enumeration table

The two forms in circulation are set out under Methods. The page uses the one Masyn (2013, Eq. 17) gives unless this is ticked.

The table appears here once the output files have been read.

The criteria against the number of classes

The plot appears here once at least two models have been read.

One model in detail

Class sizes, classification, homogeneity and separation are reported for the model chosen here.
Read only for a latent class analysis of categorical indicators.

Choose a model above.

Methods and formulas

What the page reads

For each file, the page reads the free-parameter count, sample size, loglikelihood and replication message, information criteria, entropy, class counts and proportions, average posterior probabilities, TECH11/TECH14 tests, and either response probabilities or class means. The number of classes is taken from the class-count table or, if needed, from the echoed CLASSES statement. Missing quantities are reported rather than imputed.

Two further criteria

Mplus prints the Akaike information criterion, the Bayesian information criterion and the sample-size adjusted Bayesian information criterion. Two further criteria are used in the enumeration literature and have to be computed by hand from the loglikelihood, the number of free parameters and the sample size, all of which are in the output. The consistent Akaike information criterion (Bozdogan, 1987) is

CAIC=−2(LL)+d[log(n)+1]

and the approximate weight of evidence criterion (Banfield & Raftery, 1993) is

AWE=−2(LL)+2d[log(n)+1.5]

The two sources give the criterion in different forms. Masyn (2013, Eq. 17) writes it as above, with the factor of two, attributing it to Banfield and Raftery (1993); Nylund-Gibson and Choi (2018, Table 1) write the same expression without that factor. The factor of two doubles the weight of the penalty, so the two forms can be smallest at different numbers of classes. The page computes the first and the box above the table switches it to the second, so that a table can be built in whichever form the work it is being compared with used.

Here LL is the loglikelihood, d the number of free parameters, and n the sample size. For CAIC and AWE, smaller values indicate relatively greater support within the fitted sequence; the pattern across class counts is more informative than a single isolated difference (Masyn, 2013, Eqs. 16–17).

The page recomputes the Bayesian criterion from the same three numbers and compares it with the printed one. They agree to the rounding of the output unless the file has been edited or the sample size has been read wrongly, which is why the check is made and reported.

The Bayes factor and the relative model probability (cmP)

Both are functions of the Bayesian information criterion alone. Writing the Schwarz information criterion as SIC=−0.5(BIC), the Bayes factor comparing a model A with a model B is

BFA,B=exp[SICA−SICB]

The table gives it for each model against the one with a class more. Masyn (2013, Eq. 18) prints the exponent with a plus sign and Nylund-Gibson and Choi (2018, Table 1) with a minus; the page uses the difference, which is what both texts describe in words and what the relative BIC model probability below reduces to. Read on Jeffreys' scale as both sources give it, a value between 1 and 3 is weak evidence for the model with fewer classes, between 3 and 10 moderate, above 10 strong. A value below 1 points the other way, to the model with a class more, and its reciprocal measures that evidence on the same scale.

The quantity termed correct model probability (cmP) in the cited literature is reported here as a relative BIC model probability: a BIC-based evidence share within the fitted candidate set, conditional on the assumption that the target model is represented in that set.

cmPA=exp[SICA−SICmax]∑j=1Jexp[SICj−SICmax]

Here SICmax is the largest value in the candidate set. Subtracting it before exponentiation improves numerical stability without changing the ratios. The resulting probabilities sum to one across the models loaded, so adding or removing a candidate changes every value. They describe relative support within that set and do not assess whether the set contains an adequate model.

The entropy of the classification, and the integrated completed likelihood

Mplus prints one classification summary, the relative entropy of the solution, which Masyn (2013, Eq. 23) defines as

EK=1−∑i=1n∑k=1K[−p^ikln(p^ik)]nlog(K)

Here p^ik is the posterior probability that case i belongs to class k. The double sum in the numerator is the soft posterior entropy H, in the units of the loglikelihood. The page can therefore recover it exactly from the printed relative entropy as H=(1−EK)nlog(K). With one class it is zero, since there is nothing to classify.

Biernacki, Celeux and Govaert (2000, Eq. 3.11) define ICL-BIC from the completed likelihood: the observed data are supplemented by a class allocation and the resulting likelihood is penalized in the same BIC fashion. With the MAP allocation z^i, the same criterion on the smaller-is-better scale used by Mplus can be written as

ICL-BICMAP=BIC−2∑i=1nlog(p^i,z^i)

This exact MAP form needs the case-level posterior probabilities. They are not contained in the ordinary printed summary, so it cannot in general be reconstructed from an .out file alone.

A widely used entropy approximation replaces that casewise MAP term by the soft posterior entropy H. This is the sense in which ICL-BIC is often described as BIC penalized by estimated classification entropy. Because Mplus does print relative entropy, this is the version the page can compute without requiring a separate SAVEDATA file:

ICL-BICentropy=BIC+2H=BIC+2(1−EK)nlog(K)

The table labels this value explicitly as an entropy approximation so that it is not confused with a reconstruction of the original casewise MAP completed likelihood. Both reward solutions with well separated classes; the entropy approximation is fully determined by the relative entropy printed by Mplus.

Classification

Relative entropy summarizes classification separation. Values above .80 have been used as a guideline for relatively clear individual classification (Clark & Muthén, 2009, as reported by Nylund-Gibson & Choi, 2018). Entropy is not used here to select the number of classes, because it can change with class count for reasons unrelated to comparative model support (Masyn, 2013). Class-specific diagnostics are reported separately.

The average posterior class probability of a class is the mean posterior probability of that class among the cases assigned to it (Masyn, 2013, Eq. 24). It is the diagonal of the table of average latent class probabilities for most likely class membership, which Mplus prints in full. Nagin (2005, §5.5.1) sets the working minimum at .70 for every class. The page reports the diagonal, its smallest value, and for each class the class into which its cases are most often confused, which the off-diagonal of the same table gives directly.

The odds of correct classification put that probability against what assigning at random would achieve (Nagin, 2005, Eq. 5.2; Masyn, 2013, Eq. 25):

OCCk=AvePPk/(1−AvePPk)π^k/(1−π^k)

Here π^k is the proportion the model estimates for class k. The denominator is the odds of placing a case in that class correctly by drawing at random with probability equal to its size, so a rule that does no better than chance gives 1. This is why the diagnostic is worth having next to the average posterior probability: a class that holds nine cases in ten is easy to assign to, and a high average posterior probability there says little. Nagin (2005, §5.5.2) concludes from his simulations that a value above 5 for every class indicates high assignment accuracy.

The modal class assignment proportion is the share of the sample assigned to a class by the most likely class membership, mcaPk=∑i=1nI{c^modal,i=k}/n (Masyn, 2013, Eq. 26), and Mplus prints it in the third of its three class counts tables. With perfect assignment it equals the proportion the model estimates; the gap between the two is another reading of the assignment error, and it is the third of Nagin's (2005, §5.5.3) diagnostics. The page gives both proportions and their difference. Masyn compares each modal proportion with a confidence interval for the estimated proportion obtained by bootstrap; no such interval is in the output, so the page reports the discrepancy itself and leaves the interval to a bootstrap run.

Homogeneity and separation of the classes

Two further readings of the same solution are recommended alongside the classification diagnostics (Nylund-Gibson & Choi, 2018, drawing on Masyn, 2013). Homogeneity is how alike the cases within a class are in their responses: with categorical indicators, conditional item probabilities above .70 or below .30 indicate high homogeneity, since they say that the members of the class nearly all respond in the same way to that item. Separation is how unlike the classes are in their responses: the odds ratio of an item probability between two classes above 5, or below .20, indicates high separation on that item.

ORkk′,i=pi|k/(1−pi|k)pi|k′/(1−pi|k′)

Here pi|k is the probability of the plotted category of item i in class k. The page marks every item as homogeneous or not within each class, and every pair of classes as separated or not on each item, and reports for each pair of classes how many items separate them, which is where a pair of classes that differ on one indicator only becomes visible.

With continuous indicators neither heuristic applies as stated, since both are written for probabilities. The page reports instead the standardized difference between the class means of each item,

d=μi|k−μi|k′nkσi|k2+nk′σi|k′2nk+nk′

the difference between the two class means divided by the within-class standard deviation pooled over the two classes and weighted by their sizes, which is Cohen's (1988) d computed on the model's own estimates. When the variances are constrained equal across classes, which is the Mplus default for a latent profile analysis, the denominator is that common standard deviation and the quantity is exactly Cohen's. No cutoff is attached to it here.

The likelihood ratio tests, and the replication of the loglikelihood

The two tests are read from the file rather than computed: the Vuong-Lo-Mendell-Rubin test and its adjusted form from TECH11, the parametric bootstrapped test from TECH14. Both compare a model with K classes against one with K − 1, and a p value that is not significant supports the model with fewer classes (Lo, Mendell & Rubin, 2001; McLachlan & Peel, 2000; Nylund, Asparouhov & Muthén, 2007). The page places each p value on the row of the model that requested it and states plainly when the section is missing from a file, since a series in which TECH11 and TECH14 were not requested is a series in which those columns are empty rather than one in which the tests were passed.

The page records whether the best loglikelihood was replicated across random starts. If it was not replicated, the solution may represent a local maximum; information criteria and classification diagnostics are therefore flagged. Increasing the number of random starts is the standard follow-up check.

What this page does not compute, and why

Two quantities are not reconstructed from a single .out file: bootstrap confidence intervals for class proportions, which require resampling, and the exact integrated completed likelihood, which requires case-level posterior probabilities. The table therefore reports only quantities supported by the loaded output and labels the entropy-based ICL approximation explicitly.

Self-test

Append ?selftest=1 to check output parsing, enumeration criteria, Bayes factors, relative BIC model probabilities, class diagnostics, standardized differences, and unsupported inputs.

References