Written and maintained by CASRAI Editorial Board
Published
On this page
Latent class analysis (LCA) is a person-centered finite mixture modeling technique that identifies unobserved, mutually exclusive subgroups (latent classes) within a population using multivariate categorical indicators. Originating with Paul Lazarsfeld and Neil Henry (1968) and formalized for maximum likelihood estimation by Leo Goodman (1974), LCA models the joint probability distribution of categorical survey items without arbitrary distance metrics. The model estimates two core parameters: latent class prevalences (subgroup sizes) and item-response probabilities (the likelihood that a class member endorses an indicator). Unlike variable-centered methods like multiple regression, LCA classifies respondents into distinct profiles while accounting for measurement error across different types of categorical variables.
Definition in one paragraph: What is latent class analysis
What is latent class analysis? Latent class analysis is a probabilistic clustering method for categorical data that assumes an observed population consists of a mixture of distinct, unobserved subgroups that explain the associations among observed indicator variables. In empirical research, investigators use LCA to operationalize unmeasured clinical syndromes, consumer segments, or behavioral typologies from observed response patterns. Under the axiom of local independence, LCA holds that within any single latent class, all observed indicators are statistically independent, meaning class membership fully accounts for shared variance among items. Following parameter estimation via Maximum Likelihood Estimation (MLE), individual respondents receive posterior class membership probabilities via Bayes’ theorem, providing an objective probabilistic framework distinct from qualitative approaches like document analysis.
Formula with every symbol explained: Latent class analysis formula
The latent class analysis formula formalizes how latent classes generate observed multivariate response patterns. Let Y = (Y₁, …, Y_J) denote J observed categorical indicators, where indicator j has R_j response categories r ∈ {1, …, R_j}. Let C denote a latent variable with K unobserved classes indexed by k ∈ {1, …, K}.
The unconditional marginal probability of observing a response vector y = (y₁, …, y_J) across the population is expressed by the finite mixture formula:
P(Y = y) = ∑ (k=1 to K) γ_k × ∏ (j=1 to J) ρ_(j, y_j | k)
Where every mathematical symbol represents:
- P(Y = y): Marginal probability of observing response pattern y.
- K and k: K is the total number of latent classes; k indexes a specific class (k = 1, …, K).
- γ_k = P(C = k): Latent class prevalence (prior probability) of class k, where 0 ≤ γ_k ≤ 1 and ∑ γ_k = 1.0.
- J and j: J is the total number of observed categorical indicators; j is the indicator index (j = 1, …, J).
- y_j: Observed category response on indicator j (y_j ∈ {1, …, R_j}).
- ρ_(j, y_j | k) = P(Y_j = y_j | C = k): Conditional probability of response y_j on indicator j given class k (∑ ρ_(j, r | k) = 1.0).
- ∏ (j=1 to J) ρ_(j, y_j | k): Class-conditional joint probability of pattern y, reflecting the axiom of local independence.
Posterior probabilities are calculated using Bayes’ theorem:
P(C = k | Y = y) = [γ_k × ∏ (j=1 to J) ρ_(j, y_j | k)] / [∑ (m=1 to K) γ_m × ∏ (j=1 to J) ρ_(j, y_j | m)]
Under modal assignment, respondents are assigned to the class with the highest posterior probability.
Worked example with real numbers and arithmetic shown
Consider an assessment with J = 3 binary indicators measuring symptoms: Fatigue (Y₁), Cognitive Fog (Y₂), and Sleep Disturbance (Y₃), scored 1 (Present) or 0 (Absent). The model specifies K = 2 latent classes: Class 1 (High Burden) and Class 2 (Low Burden).
Estimated parameters:
- Prevalences: γ₁ = 0.40; γ₂ = 0.60.
- Endorsement (Y_j = 1): Fatigue: ρ_(1, 1 | 1) = 0.85, ρ_(1, 1 | 2) = 0.20; Fog: ρ_(2, 1 | 1) = 0.80, ρ_(2, 1 | 2) = 0.10; Sleep: ρ_(3, 1 | 1) = 0.75, ρ_(3, 1 | 2) = 0.30.
- Absence (Y_j = 0): Fatigue: ρ_(1, 0 | 1) = 0.15, ρ_(1, 0 | 2) = 0.80; Fog: ρ_(2, 0 | 1) = 0.20, ρ_(2, 0 | 2) = 0.90; Sleep: ρ_(3, 0 | 1) = 0.25, ρ_(3, 0 | 2) = 0.70.
Evaluate a patient with response profile y = (1, 1, 0) (Fatigue and Fog present, Sleep Disturbance absent):
Step 1: Class Likelihoods
Class 1: P(Y = (1, 1, 0) | C = 1) = 0.85 × 0.80 × 0.25 = 0.1700
Class 2: P(Y = (1, 1, 0) | C = 2) = 0.20 × 0.10 × 0.70 = 0.0140
Step 2: Weighted Likelihoods
Class 1 Joint: 0.40 × 0.1700 = 0.0680
Class 2 Joint: 0.60 × 0.0140 = 0.0084
Step 3: Total Marginal Probability
P(Y = (1, 1, 0)) = 0.0680 + 0.0084 = 0.0764 (7.64% of cohort)
Step 4: Posterior Probabilities
Class 1: P(C = 1 | Y = (1, 1, 0)) = 0.0680 / 0.0764 ≈ 0.89005 (89.01%)
Class 2: P(C = 2 | Y = (1, 1, 0)) = 0.0084 / 0.0764 ≈ 0.10995 (10.99%)
Sum = 0.89005 + 0.10995 = 1.0000. Modal assignment places the respondent in Class 1 with 89.01% certainty.
Interpretation: what the result means, with a table of reading guidance
Interpreting LCA requires evaluating profile characteristics and model enumeration fit statistics. Item probabilities above 0.70 identify characteristic traits for a class, while probabilities below 0.30 indicate non-endorsed attributes. In consumer segmentation, these profiles complement preference models such as conjoint analysis.
| Fit Statistic | Formula / Basis | Reading Guidance & Decision Rule | Primary Source |
|---|---|---|---|
| BIC | -2 ln(L) + p × ln(N) | Lower value indicates superior fit and parsimony; primary index for class enumeration. | Nylund et al. (2007) |
| AIC | -2 ln(L) + 2p | Lower value indicates better fit; tends to over-extract classes in larger samples. | Sinha et al. (2021) |
| SABIC | -2 ln(L) + p × ln((N + 2) / 24) | Lower value indicates better fit; adjusts BIC penalty in smaller samples. | Sinha et al. (2021) |
| Entropy | 1 – [∑∑ -p_ik ln(p_ik)] / [N ln(K)] | Scale 0.0 to 1.0. Values ≥ 0.80 indicate strong separation; < 0.60 indicates poor precision. | Celeux & Soromenho (1996) |
| BLRT | Bootstrap distribution of -2ΔLL | Tests k vs. (k – 1) classes. Significant p-value (p < 0.05) supports adding the k-th class. | Nylund et al. (2007) |
| Smallest Class | Minimum estimated γ_k | Classes comprising < 5% warrant caution as potential mathematical artifacts. | Sinha et al. (2021) |
Latent class analysis vs cluster analysis and latent profile analysis
Researchers frequently contrast latent class analysis with other clustering algorithms, including K-means and Latent Profile Analysis (LPA).
Latent Class Analysis vs. Cluster Analysis
K-means and hierarchical clustering are distance-based heuristics minimizing Euclidean distances. When applied to categorical data, cluster analysis exhibits severe limitations: calculating geometric distances across binary or nominal scales is mathematically invalid, measurement error is ignored, and heuristic algorithms lack likelihood-based fit statistics (like BIC or BLRT) to determine cluster counts. In contrast, LCA is a model-based probabilistic framework explicitly tailored for categorical data.
Latent Class Analysis vs. Latent Profile Analysis
LCA and Latent Profile Analysis (LPA) belong to the finite mixture model family and share identical goals: identifying unobserved subgroups. The technical distinction lies in indicator distributions:
- Latent Class Analysis (LCA): Models observed categorical indicators using multinomial distributions.
- Latent Profile Analysis (LPA): Models observed continuous indicators using multivariate normal distributions with estimated means and variances.
Latent Class Analysis in Epidemiology
In epidemiology, LCA is an analytical standard for discovering unobserved clinical phenotypes in heterogeneous conditions, such as acute respiratory distress syndrome (ARDS), sepsis, and multimorbidity clusters, enabling precision medicine interventions.
Assumptions and common mistakes
Conducting sound latent class modeling requires observing key assumptions and avoiding frequent pitfalls.
Core Modeling Assumptions
- Axiom of Local Independence: Indicators within each class are statistically independent. Correlated indicator residuals (e.g., from redundant survey wording) cause software to extract spurious classes. Researchers should inspect bivariate residuals (BVRs) and combine redundant items when operationalizing variables.
- Mutually Exclusive Classes: Each individual belongs to one and only one true latent class.
- Adequate Sample Size: Samples below 300 to 500 cases can produce unstable solutions and boundary estimates (probabilities of 0.0 or 1.0).
Common Methodological Mistakes
- Local Maxima: The EM algorithm can terminate at local likelihood peaks. Running models with a single random start is a serious error; analysts should specify 100 to 500 random starts to replicate the best log-likelihood.
- Over-Relying on Entropy: Entropy measures assignment clarity, not model fit. Selecting class count solely by highest entropy often leads to over-extraction.
- The Naive Three-Step Error: Treating assigned classes as observed categorical variables in downstream regression introduces classification error bias. Researchers must use modern bias-corrected three-step methods (e.g., BCH or Vermunt ML).
How to report it (APA example)
Reporting latent class analysis per American Psychological Association (APA 7th edition) guidelines requires documenting estimation settings, enumeration criteria, and class parameters.
APA 7th Style Results Write-Up:
An unconditional latent class analysis (LCA) was conducted using maximum likelihood estimation with robust standard errors across one to three classes. To prevent convergence on local maxima, models used 500 random starts and 50 final optimizations. Class enumeration was evaluated using BIC, SABIC, BLRT, entropy, and substantive interpretability.
As shown in Table 1, the two-class solution demonstrated superior fit, reaching the minimum BIC (BIC = 4,218.42) compared to the one-class (BIC = 4,680.15) and three-class (BIC = 4,256.80) models. Although the three-class BLRT was significant (p = 0.032), the third class comprised only 2.8% of the sample (n = 14) and lacked distinct item profiles. The two-class model achieved high entropy (0.84). Class 1 (High Burden; 41.2%) showed high endorsement for fatigue (ρ = 0.85) and cognitive fog (ρ = 0.80), while Class 2 (Low Burden; 58.8%) exhibited low endorsement (ρ ≤ 0.20). Mean posterior probabilities were 0.91 and 0.93, confirming clean classification.
Table 1: Fit Indices for Latent Class Enumeration (N = 500)
| Model | LL | p | AIC | BIC | SABIC | Entropy | BLRT p | Min Class |
|---|---|---|---|---|---|---|---|---|
| 1-Class | -2,328.08 | 3 | 4,662.16 | 4,680.15 | 4,666.52 | — | — | 100.0% |
| 2-Class | -2,085.19 | 7 | 4,184.38 | 4,218.42 | 4,192.64 | 0.84 | < .001 | 41.2% |
| 3-Class | -2,081.36 | 11 | 4,184.72 | 4,256.80 | 4,197.83 | 0.81 | .032 | 2.8% |
How to calculate it in Excel, R or Python
Analysts implement latent class analysis across standard computing environments, from spreadsheet probability calculations to dedicated packages.
1. Calculation in Microsoft Excel
Place class priors in B2:C2 (0.40, 0.60), endorsement probabilities in B4:C6, and profile (1, 1, 0) in D4:D6. Enter the array formula for Class 1 joint likelihood in cell B8:
=B2 * PRODUCT(IF(D4:D6=1, B4:B6, 1-B4:B6))
For Class 2 in cell C8: =C2 * PRODUCT(IF(D4:D6=1, C4:C6, 1-C4:C6)). Class 1 posterior probability in cell B10: =B8 / (B8 + C8).
2. Latent Class Analysis in R
In R, the poLCA package estimates latent class models with categorical indicators (coded 1 and 2):
library(poLCA)
f <- cbind(y1, y2, y3) ~ 1
set.seed(12345)
lca_fit <- poLCA(f, data = df, nclass = 2, nrep = 50, verbose = FALSE)
print(lca_fit$bic)
print(lca_fit$P) # Class prevalences
print(lca_fit$probs) # Item probabilities
head(lca_fit$posterior)
3. Latent Class Analysis in Python
In Python, StepMix performs generalized latent class and mixture modeling:
import numpy as np
from stepmix.stepmix import StepMix
X = np.array([[1, 1, 0], [1, 1, 1], [0, 0, 1], [0, 1, 0], [1, 0, 0], [0, 0, 0]])
model = StepMix(n_components=2, measurement="binary", n_init=50, random_state=42)
model.fit(X)
print(f"BIC: {model.bic(X):.2f}")
print("Prevalences:", model.weights_)
print("Posterior Probabilities:n", model.predict_proba(X))
In Stata, LCA is estimated via gsem (y1 y2 y3 <- ), lclass(C 2); SPSS supports LCA via Latent GOLD or Python integration.
FAQ
What is latent class analysis?
Latent class analysis (LCA) is a statistical finite mixture modeling technique that identifies unobserved subgroups (latent classes) within a population based on patterns of multivariate categorical responses, estimating subgroup sizes and item-response probabilities.
What is the difference between latent class analysis and cluster analysis?
While traditional cluster analysis (such as K-means) relies on heuristic geometric distance metrics and hard group assignment without accounting for measurement error, LCA is a model-based probabilistic technique that uses maximum likelihood estimation and outputs posterior class membership probabilities.
What is the difference between latent class analysis and latent profile analysis?
The distinction lies in the measurement level of the indicator variables: Latent Class Analysis (LCA) uses categorical (binary, nominal, or ordinal) indicators, whereas Latent Profile Analysis (LPA) uses continuous indicators modeled with multivariate normal distributions.
How do you decide how many classes to extract in LCA?
Researchers evaluate models with increasing class counts, prioritizing the lowest Bayesian Information Criterion (BIC), statistically significant Bootstrap Likelihood Ratio Tests (BLRT p < 0.05), classification entropy (≥ 0.80), and theoretical interpretability, avoiding classes with fewer than 5% of cases.
How does latent class analysis handle missing data?
Under Full Information Maximum Likelihood (FIML) estimation, modern LCA software models all available responses under the Missing at Random (MAR) assumption, avoiding the statistical power loss and bias associated with listwise deletion.
Sources
- Sinha, P., Calfee, C. S., & Delucchi, K. L. (2021). Practitioner’s Guide to Latent Class Analysis: Methodological Considerations and Common Pitfalls. Critical Care Medicine, 49(1), e63–e79. PMCID: PMC7746621. Read 2026-11-09: https://pmc.ncbi.nlm.nih.gov/articles/PMC7746621/
- UCLA Statistical Consulting Group (OARC). (2023). Latent Class Analysis | Mplus Data Analysis Examples. Read 2026-11-09: https://stats.oarc.ucla.edu/mplus/dae/latent-class-analysis/
- StataCorp. (2023). Latent class analysis (LCA) | Stata 18 Base Reference Manual. Read 2026-11-09: https://www.stata.com/features/overview/latent-class-analysis/
- Collins, L. M., & Lanza, S. T. (2010). Latent Class and Latent Transition Analysis: With Applications in the Social, Behavioral, and Health Sciences. John Wiley & Sons. ISBN: 978-0-470-22839-5.
- Goodman, L. A. (1974). Exploratory latent structure analysis using both identifiable and unidentifiable models. Biometrika, 61(2), 215–231. https://doi.org/10.1093/biomet/61.2.215







