These models include example Latent GOLD code. Latent GOLD and its corresponding documentation is available at www.statisticalinnovations.com. Note that we recommend the “advance syntax” version.
LCA: Baseline LCA with all binary indicators
This code fits a 4-class, baseline, latent-class model for marijuana use and attitudes using 7 binary indicators of the latent class variable. This code also plots the item-response probabilities using a line graph.
LCA: Latent class moderation
This code demonstrates how to use a latent class moderator to examine heterogeneity in intervention effects among adolescents receiving treatment for cannabis use. First, the code identifies latent classes of contextual and individual risk at baseline using LCA. Then, it uses an adjusted 3-step approach with BCH weights to regress the outcomes on level of care, latent class membership, the interaction between them, and covariates.
LCA: LCA with a covariate (1-step approach)
This code fits a 4-class, latent-class model for marijuana use and attitudes using a model-based approach (1-step approach). It includes a covariate for grades in the model.
LCA: LCA with a covariate and a grouping variable (1-step approach)
This code fits a 4-class, latent-class model for marijuana use and attitudes using a model-based approach (1-step approach). It includes a covariate for grades and a grouping variable for year in the model.
LCA: LCA with a grouping variable and measurement invariance
This code fits a 4-class, latent-class model for marijuana use and attitudes using 7 binary indicators of the latent class variable. It includes a grouping variable for year, and observations came from 3 different years.
LCA: LCA with a grouping variable and without measurement variance
This code fits a 4-class, latent-class model for marijuana use and attitudes using 7 binary indicators of the latent class variable. It includes a grouping variable for year, and observations came from 3 different years. Measurement invariance across groups is not imposed resulting in an unrestricted latent class model with multiple groups.
LPA: Baseline LPA with all continuous indicators
This code fits a 5-class, baseline, latent-profile model for the “Big 5” personality traits using 5 continuous indicators of the latent class variable.
LPA: Baseline LPA with all continuous indicators and a covariate
This code fits a baseline, latent-profile model for the “Big 5” personality traits using 5 continuous indicators of the latent class variable and biological sex as a covariate.
LPA: Baseline LPA with all continuous indicators and a grouping variable with measurement invariance
This code fits a baseline, latent-profile model for the “Big 5” personality traits using 5 continuous indicators of the latent class variable and biological sex as the grouping variable. It also imposes measurement invariance across the groups.
LTA: Baseline LTA with 2 times, all binary indicators, and measurement invariance
This code fits a 2-time, 5-class, latent-transition model for delinquency over time using 6 binary indicators of the latent class variable. Measurement invariance across time is imposed such that analogous item-response probabilities within classes are restricted to be equal to each other across times.

Let’s stay in touch.
We are in this together. Receive an email whenever a new model or resource is added to the Knowledge Base website.