Author-reviewedEvidence: highv1.0.1

Latent Class Analysis

Latent class analysis (LCA) finds unobserved patient subgroups from patterns in categorical data, such as recorded conditions or diagnostic test results.

Last reviewed byDr Darrin Baines

Concept Architecture

Latent Class Analysis in Patient Classification and Diagnostic Accuracy

Latent class analysis (LCA) groups people whose group cannot be read off any single variable, only off the way several categorical measures occur together. Each person receives a probability of belonging to each class, alongside estimates of how common each class is. In health economics the method defines patient subgroups with different service use and outcomes, and it estimates the sensitivity and specificity of diagnostic tests when no test can act as a reference standard. Both outputs often feed a decision model, so the assumption of local independence and the chosen number of classes carry through to the cost-effectiveness result.

The latent class model for categorical indicators

LCA belongs to the family of finite mixture models. Sinha, Calfee and Delucchi describe LCA as the form of finite mixture modelling in which all observed indicators are categorical, with latent profile analysis as the continuous counterpart. The class is a latent variable with a fixed number of categories, and the model writes the probability of a full response pattern as a weighted sum over classes.

P(Yi=y)=∑k=1Kπk∏j=1JP(Yij=yj∣Ci=k)P(\mathbf{Y}_i = \mathbf{y}) = \sum_{k=1}^{K} \pi_k \prod_{j=1}^{J} P(Y_{ij} = y_j \mid C_i = k)

where Yi\mathbf{Y}_i is the vector of JJ categorical indicators for person ii, y\mathbf{y} is one response pattern, KK is the number of classes, πk\pi_k is the population share of class kk, CiC_i is the unobserved class of person ii, and P(Yij=yj∣Ci=k)P(Y_{ij} = y_j \mid C_i = k) is the item-response probability of response yjy_j on indicator jj in class kk.

The product inside the sum is local independence. Within a class the indicators are assumed independent, so any association between them in the whole sample is attributed to differences between classes. The ISPOR primer by Law and Harrington notes that the classes are interpreted by comparing item-response probabilities between them. The parameter count grows quickly with the indicators.

d=(K−1)+K∑j=1J(Rj−1)d = (K - 1) + K \sum_{j=1}^{J} (R_j - 1)

where dd is the number of free parameters and RjR_j is the number of response categories of indicator jj. With 38 binary indicators and three classes, d=2+3×38=116d = 2 + 3 \times 38 = 116.

After fitting, Bayes' theorem gives each person a posterior probability of membership in each class.

P(Ci=k∣y)=πk∏jP(yj∣k)∑m=1Kπm∏jP(yj∣m)P(C_i = k \mid \mathbf{y}) = \frac{\pi_k \prod_{j} P(y_j \mid k)}{\sum_{m=1}^{K} \pi_m \prod_{j} P(y_j \mid m)}

where P(yj∣k)P(y_j \mid k) is shorthand for the item-response probability above and the denominator sums the same product over all classes mm. Sinha and colleagues stress that the model itself assigns nobody to a class.

Estimation and the number of classes

Parameters are usually estimated by maximum likelihood estimation, and the likelihood can have local maxima. Sinha and colleagues recommend at least 50 random starts, with the maximum likelihood replicated at least 20 times. Models with one, two and more classes are compared, and since an extra class always improves fit to the sample, selection relies on the Bayesian information criterion, the Akaike information criterion and tests of KK against K−1K - 1 classes. They cite simulations by Nylund and colleagues in which BIC tended to beat AIC, especially in large samples, and information criteria and likelihood tests found the correct model with 500 or 1,000 observations but not with 200. They treat LCA as a large-sample method whose results are less reliable below about 300.

Fit statistics are only part of the choice. Entropy summarises how sharply the posterior probabilities separate the classes, but an over-fitted model tends to have high entropy, so entropy should not decide the model. Warning signs include a two-class model with a class under 15% of the sample, and the "salsa effect", in which one population is forced into levels of severity whose profiles run parallel.

Where latent class analysis is used in health economics

The method enters health economic work mainly through patient classification and diagnostic accuracy. Preference classes in a discrete choice experiment, estimated with a latent class logit, are covered on the latent class model page.

Patient subgroups from records and trial cohorts

Zhu and colleagues applied LCA to linked primary and secondary care records from 382 general practices in England in the Clinical Practice Research Datalink. They coded 38 long-term conditions as present or absent for 113,211 multimorbid adults, derived clusters in a random 80% and checked them in the remaining 20%. Choosing the number of classes with BIC, sample-size adjusted BIC, a likelihood ratio test, entropy and clinical judgement, they found 20 clusters across four age strata and linked them to GP consultations, hospitalisations, regular medications and mortality. Among people aged 18 to 64 the cluster with the highest service use combined depression, anxiety and pain. Sinha and colleagues report two phenotypes of acute respiratory distress syndrome, found in five trial cohorts, that responded differently to randomised interventions in secondary analyses of three trials.

Diagnostic accuracy without a reference standard

When no test is a perfect reference standard, comparing a new test with an imperfect one biases its estimated accuracy. A latent class model treats true disease status as the latent variable with two classes, so the class shares give the prevalence and the item-response probabilities give each test's sensitivity and specificity. Collins and Huynh trace the approach to Hui and Walter in 1980. With two tests in one population there are three degrees of freedom but five parameters, so the model is not identifiable. In general nn binary tests in gg populations give g(2n−1)g(2^n - 1) degrees of freedom for g+2ng + 2n parameters under conditional independence and test accuracy that does not vary between populations, and equal numbers do not guarantee identification. Van Smeden and colleagues reviewed 64 diagnostic studies using latent class models, 59% in infectious diseases. In 61% the critical assumption was independence of test results within two classes, and 28% reported nothing that would allow assumptions or performance to be checked.

Worked example with three tests and no reference standard

All numbers in this example are illustrative. A new rapid test C for an infection has been used alongside two existing tests, A and B, on the same 1,000 people, and none is a reference standard. The tests work by different mechanisms, so conditional independence is assumed, and the fitted two-class model gives a prevalence of 0.20, sensitivities of 0.90, 0.80 and 0.70 for A, B and C, and specificities of 0.95, 0.98 and 0.90.

1. Identification. Three binary tests give 8 response patterns whose probabilities sum to one, so 7 degrees of freedom. The model has 1 + 2 × 3 = 7 parameters, and Collins and Huynh note that three tests in one population have an exact solution, so it is just identified and no degrees of freedom remain to test conditional independence.

2. One pattern. For A and B positive with C negative, the infected class contributes 0.20 × 0.90 × 0.80 × 0.30 = 0.0432 and the uninfected class 0.80 × 0.05 × 0.02 × 0.90 = 0.00072. The pattern probability is 0.04392, about 44 people per 1,000, and the posterior probability of infection is 0.0432 / 0.04392 = 0.984.

3. An ambiguous pattern. For A positive with B and C negative, the classes give 0.20 × 0.90 × 0.20 × 0.30 = 0.0108 and 0.80 × 0.05 × 0.98 × 0.90 = 0.03528, a total of 0.04608 or about 46 people. The posterior probability of infection is 0.0108 / 0.04608 = 0.234, so assignment to the most likely class labels all 46 uninfected although 1,000 × 0.0108 = 10.8 of them are infected.

4. Error from modal assignment. Across all eight patterns, the four with a posterior above 0.5 hold 186.6 people per 1,000, against 200 expected in the infected class. About 25.8 per 1,000 are misclassified, 19.6 infected people labelled uninfected and 6.2 uninfected people labelled infected.

5. Bias from an imperfect reference. Had A been used as the reference standard, the formula on the reference standard page would give C an apparent sensitivity of 0.130 / 0.220 = 0.591 and an apparent specificity of 0.690 / 0.780 = 0.885, both below the true 0.70 and 0.90.

6. Interpretation. A decision model using the naive estimate would expect C to detect 591 of every 1,000 infected people, against 700 under the latent class estimates. Those estimates rest in turn on the assumption that step 1 showed cannot be tested.

Assumptions that carry the results

Some failures do not show in fit statistics. Sinha and colleagues report that violating local independence can bias parameters, cause misclassification and lead fit statistics to overestimate the number of classes, and they suggest checking correlations between indicators within the fitted classes. Albert and Dodd showed that misspecified dependence between diagnostic tests can bias sensitivity, specificity and prevalence, and that with few tests likelihood comparisons may not distinguish dependence structures. Umemneku Chikere and colleagues add that models with different dependence structures have produced different accuracy estimates while each still fitted well. Sinha and colleagues also advise against using outcomes as indicators in a discovery analysis, since later outcome differences would partly restate the inputs.

Using latent classes in economic evaluation and HTA

Latent classes usually enter an evaluation as candidate subgroups. The NICE manual (PMG36, sections 4.9.3 and 4.9.4) asks that subgroups be clearly defined, preferably from a justified expectation of differential clinical or cost effectiveness, and says that post hoc data dredging for subgroup effects will be viewed sceptically. Section 4.9.7 asks for the precision of all subgroup estimates to be reflected in the analysis of parameter uncertainty, and section 4.9.12 treats subgroups based solely on individual utilities for health states and patient preference as not relevant.

Lanza and Rhoades argue that latent subgroups can ease the high Type I error rate, low power and difficulty with higher-order interactions that affect subgroup analysis. They warn that assigning each person to a class and then comparing treatment effects is biased to the extent that there is classification error, and they regard a model-based approach as always preferable. A cost-effectiveness model built on latent classes therefore keeps each person's membership probabilities, not a fixed label, in the probabilistic sensitivity analysis.

Boundaries with neighbouring methods

Several neighbouring methods answer different questions. The choice depends on the type of indicator and whether the latent quantity is a category or a continuum.

MethodDifference from LCA
Cluster analysisDistance-based methods such as k-means give hard assignments without a probability model
Factor analysisThe latent variable is continuous
Latent transition analysisLatent classes at several time points, with transitions between them
Growth mixture modelClasses of trajectories in repeated measures

Limitations and common misreadings

Most misreadings treat fitted classes as more certain or more real than the data allow. Four recur.

  1. Classes read as natural kinds. A model with several classes can fit a population that has none, and a one-class answer may be the truth. External replication is the main safeguard.
  2. Labels read as certain. Modal assignment discards the posterior probabilities and biases comparisons between classes.
  3. Fit read as proof of local independence. In a just-identified diagnostic model the assumption cannot be tested.
  4. Small samples. Below a few hundred observations the number of classes is hard to recover.

Sources

Library

Publications

1
  • Book

    Bayesian Methods in Health Economics — Gianluca Baio, 1st Edition ed., 2012 (Chapman & Hall / CRC Press)

    An overview of Bayesian statistical methods for the analysis of health economic data, covering economic evaluation concepts, statistical cost-effectiveness analysis, Bayesian computation and MCMC, and applied health economic evaluation.

Frequently Asked Questions (6)

  • What is latent class analysis?

    Latent class analysis (LCA) finds unobserved patient subgroups from patterns in categorical data, such as recorded conditions or diagnostic test results.

    Source: Sinha et al. 2021; Collins & Huynh 2014

  • What kind of hidden subgroups does latent class analysis uncover?

    In latent class analysis the subgroups are the categories of one unobserved variable, so each person belongs to one of a fixed number of mutually exclusive classes, although the model gives only the probability of each. The classes are inferred from the way several categorical measures occur together, never from any single variable. Zhu and colleagues coded 38 long-term conditions as present or absent for 113,211 multimorbid adults in linked English primary and secondary care records and found 20 clusters across four age strata. Among people aged 18 to 64, the cluster with the highest service use combined depression, anxiety and pain.

    Source: Zhu et al. 2020

  • How does latent class analysis work?

    Latent class analysis fits a model in which an unobserved categorical variable accounts for the pattern of responses on several observed categorical indicators. Two sets of parameters are estimated together, the class membership probabilities, which give the share of the population in each class, and the item-response probabilities, which give the chance of each response on each indicator within each class. Within a class the indicators are assumed independent, so any association between them in the whole sample is attributed to differences between classes. The classes are then interpreted by comparing their item-response probabilities, and each person receives a probability of belonging to each class.

    Source: Law & Harrington 2016

  • When is latent class analysis used?

    Latent class analysis is used when the grouping of interest cannot be observed directly and only categorical indicators of it are available. A common health economic case is estimating the sensitivity and specificity of diagnostic tests when no test can act as a reference standard, since judging a new test against an imperfect one can bias its estimated accuracy. The model treats true disease status as an unobserved variable with two classes, so the class shares give the prevalence and the item-response probabilities give each test's accuracy. With two tests in one population there are three degrees of freedom for five parameters, so more tests or populations are needed.

    Source: Collins & Huynh 2014

  • How is the number of classes chosen in latent class analysis?

    In latent class analysis, models with one, two and more classes are fitted in turn and compared, because an extra class always improves fit to the sample. Sinha and colleagues describe selection based on the Bayesian information criterion, the Akaike information criterion and tests of each model against one with a class fewer, and they cite simulations in which BIC tended to beat AIC, especially in large samples. Entropy shows how sharply the classes separate, but an over-fitted model tends to have high entropy, so it should not decide the choice. A two-class solution containing a class under 15% of the sample is treated as a warning sign.

    Source: Sinha et al. 2021

  • What are the limitations of latent class analysis?

    Latent class analysis rests on local independence, the assumption that indicators are unrelated within each class, and Sinha and colleagues report that violating it can bias parameters, cause misclassification and lead fit statistics to overestimate the number of classes. They suggest checking correlations between indicators within the fitted classes once a model is chosen. The method needs large samples, and its results are less reliable below about 300 observations. Using clinical outcomes as indicators in a discovery analysis introduces circularity, since later differences in outcomes would partly restate the inputs. The model also assigns nobody to a class, so treating each person's most likely class as certain discards information.

    Source: Sinha et al. 2021

Trust Record

Verified by Dr Darrin Baines

British health economist

Professional identity: darrinbaines.org

Verification date: 26 Oct 2026

Content version: 1.0.1

Canonical Identity

Term code
HE-ES-SA-096

Stable URI · Machine-readable · Resolvable · CC BY 4.0