Three-Step Estimation for Latent Class Analysis

Bias-adjusted three-step estimation of latent class models with covariates and distal outcomes. The latent class measurement model is estimated first, with 'multilevLCA' (Lyrvall et al., 2025) , and held fixed; observations are then classified; and the classes are related to covariates and distal outcomes with the maximum likelihood correction of Vermunt (2010) and Bakk, Tekle and Vermunt (2013) , or the correction of Bolck, Croon and Hagenaars (2004) . Standard errors account for the uncertainty of the measurement model (Bakk, Oberski and Vermunt, 2014) . Includes class enumeration, modal and proportional class assignment, covariate formulas, Gaussian, Poisson, binomial, and multinomial distal outcomes, the two-step estimator of Bakk and Kuha (2018) , measurement models applied to new samples, and full-information maximum likelihood for missing indicators, standard methods for fitted models, and a data-generating process replicating the simulation design of Bakk and Kuha (2018).


tseLCA

CRAN status

Overview

tseLCA (Three-Step Estimation for Latent Class Analysis) relates latent classes to covariates and distal outcomes by bias-adjusted three-step estimation.

  1. Measurement model (tse_lca()). The latent classes are estimated from the indicators alone, and the number of classes is chosen from a class-enumeration table.
  2. Classification (tse_classify()). Observations are assigned to classes, and the classification error is estimated.
  3. Structural model (tse_covariate(), tse_distal()). The classes are related to covariates and/or distal outcomes, with the ML (Vermunt 2010) or BCH (Bolck, Croon & Hagenaars 2004) correction for classification error.

Because the measurement model is fixed before any structural variable enters, covariates and outcomes cannot change what the classes mean. This is the key difference from one-step estimation (e.g. poLCA), where the class solution can shift with every change to the structural model. The standard errors of the structural estimates account for the uncertainty of the measurement model (Bakk, Oberski & Vermunt 2014). Measurement models are estimated with multilevLCA.

Features

  • Class enumeration with AIC, BIC, SABIC, entropy, and class sizes.
  • ML and BCH three-step estimators, with modal or proportional assignment. The uncorrected estimator is also available, for comparison.
  • Standard errors corrected for the uncertainty of the measurement model.
  • Covariate formulas with factors, interactions, and transformations. Wald tests by term, predicted class probabilities, and any reference class.
  • Gaussian, Poisson, binomial, and multinomial distal outcomes, alone or combined with covariates, and an omnibus test of equality across classes.
  • Measurement models estimated on one sample and applied to another.
  • Indicators as factors, logicals, characters, or numeric codes. Full-information maximum likelihood for missing indicator values.
  • Standard R methods throughout: summary(), coef(), vcov(), confint(), logLik(), AIC(), BIC(), predict(), plot(), update().

Installation

install.packages("tseLCA")

# development version
# install.packages("pak")
pak::pak("SamLeeBYU/tseLCA")

Example

library(tseLCA)

# Simulated data: six binary indicators, a covariate Zp, and a distal outcome Zo
d <- generate_data(n = 1000, separation = "high", scenario = "covariate", seed = 1)
d$Zo <- draw_Zo(d$X, bk2018_params$distal_params)

# Step 1: choose the number of classes from the measurement model
sel <- tse_lca(cbind(Y1, Y2, Y3, Y4, Y5, Y6) ~ 1, data = d, nclass = 1:4)
sel
m <- best_model(sel, criterion = "BIC")

# Step 2: classification
cl <- tse_classify(m)

# Step 3: covariate and distal outcome models
fc <- tse_covariate(cl, ~ Zp)
summary(fc)
fb <- tse_distal(fc, Zo ~ 1)
summary(fb)

# The same model in one call
fit <- tseLCA(cbind(Y1, Y2, Y3, Y4, Y5, Y6) ~ Zp | Zo, data = d, nclass = 3)

See the introductory vignette for the full workflow.

Upgrading from tseLCA 1.x

three_step() still works, with the same estimates, but is deprecated. Its help page, and the vignette, map each of its arguments to the new functions. Version 2.0.0 also fixes several estimation bugs; see NEWS.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("tseLCA")

2.0.0 by Sam Lee, 10 days ago


https://samleebyu.github.io/tseLCA/, https://github.com/SamLeeBYU/tseLCA


Report a bug at https://github.com/SamLeeBYU/tseLCA/issues


Browse source code at https://github.com/cran/tseLCA


Authors: Sam Lee [aut, cre, cph] (ORCID: , Jay Goodliffe [aut, cph]


Documentation:   PDF Manual  


GPL (>= 3) license


Imports cli, Formula, multilevLCA

Suggests nnet, poLCA, testthat, parallel, knitr, rmarkdown, spelling


See at CRAN