*! version 1.2 21oct2023

step3 Bias-Adjusted 3Step Latent Class Analysis

Syntax

step3 varlist, posterior(stub) id(varname) [distal uneq base(#) rrr pval diff iter(#)]

Description

step3 is a bias-adjusted method to relate latent class membership to external variables, which can be either covariates or distal outcomes.

The command performs the ML three-step procedure described by Vermunt (2010) with modal assignment.
The first step - latent class analysis without covariates/distal outcomes - must be performed separately.
This can be done with any command, as long as it produces membership posterior probabilities.

In addition, the program quietly runs a test to ensure that the composition of the classes does not change after adding covariates/distal outcomes to the model.
If the composition does change, the command will execute the analysis with classical proportional assignment, estimating the variances with the sandwich estimator.

Options

posterior(stub) is required. It specifies the prefix for the membership posterior probabilities estimated in the first step.
To avoid errors, it is advisable to choose a prefix that only returns the posterior probability variables when followed by *.

id(varname) is required. It specifies the identifier variable for observations.

distal specifies that the variable in varlist is the outcome of latent classes rather than a covariate.
In varlist it is advisable to use the appropriate i. operator before a factor variable to prevent errors.

uneq specifies to relax the assumption of equal variances across classes.

base(#) specifies the reference class that will be used as the base outcome; default is base(1).

rrr will report the results in relative risk ratios.

pval will report the exact p-value instead of stars.

diff specifies to use a different stepping algorithm in nonconcave regions.

iter(#) specifies the maximum number of iterations; default is iter(20).

Example

Setup

. webuse gsem_lca2.dta, clear

Three categories of diabetes based on glucose, insulin, and sspg

. gsem (glucose insulin sspg <-), lclass(C 3) lcinvariant(none) covstructure(e._OEn, un)

Posterior class membership probabilities

. predict pr_*, classposteriorpr

Use relwgt as predictor of class membership with classic modal assignment

. egen max = rowmax(pr_*)

. generate modal_class = 1

. replace modal_class = 2 if max == pr_2

. replace modal_class = 3 if max == pr_3

. mlogit modal_class relwgt

Use relwgt as predictor of class membership with step3

. step3 relwgt, posterior(pr_) id(patient)

Although the latent profiles are well differentiated (Entropy > 0.8), the results of the analysis using the classic modal assignment are slightly underestimated.
This phenomenon is more evident and problematic at lower entropy levels.

Reference

Vermunt, J. K. (2010).
Latent class modeling with covariates: Two improved three-step approaches.
Political Analysis, 18, 450–469.

Author

Giovanbattista Califano

University of Naples Federico II

Dept. Agricultural Sciences – Economics and Policy Group

giovanbattista.califano@unina.it