Lab 10.2 - Latent Profile Analysis

Structural Equation Modeling - Instructor: Karen Nylund-Gibson

Adam Garber

June 07, 2020

University of California, Santa Barbara

Figure. Gaussian mixture models. Data simulated from a 2-class model.


Lab preparation


Creating a version-controlled R-Project with Github

Download repository here: https://github.com/garberadamc/SEM-Lab10

On the Github repository webpage:

  1. fork your own branch of the lab repository
  2. copy the repository web URL address from the clone or download menu

Within R-Studio:

  1. click “NEW PROJECT”
  2. choose option Version Control
  3. choose option Git
  4. paste the repository web URL path copied from the clone or download menu on Github page
  5. choose location of the R-Project

Data source:

  1. The first example closely follows the vignette used to demonstrate the tidyLPA package (Rosenberg, 2019): \(\color{blue}{\text{See detailed documentation of this model here}}\)

This model utilizes the PISA data collected in the U.S. in 2015. To learn more about this data \(\color{blue}{\text{see here}}\).

To access the 2015 US PISA data in R use the following code: a. devtools::install_github("jrosen48/pisaUSA15") b. library(pisaUSA15) c. open_codebook()

  1. The second examples utilizes 4 test score measures from the public-use dataset, The Longitudinal Survey of American Youth (LSAY): \(\color{blue}{\text{See documentation here}}\)

Load packages

Load data


Latent Profile Analysis


Figure. Picture adapted from tutorial (Rosenberg, 2019).

  • model 1: Equal variances, and covariances fixed to 0 (Class-invariant / Diagonal)
  • model 2: Free variances and covariances fixed to 0 (Class-varying / Diagonal)
  • model 3: Equal variances and equal covariances (Class-invariant / Non-Diagonal)
  • model 4: Free variances, and equal covariances
  • model 5: Equal variances, and free covariances
  • model 6: Free variances and free covariances (Class Varying / Non-Diagonal)

Example 1: PISA dataset from the tidyLPA package


Enumerate using estimate_profiles():

  • Estimate models with classes \(K = 1:3\) using Mplus
  • Model has 4 continuous indicators
  • Default variance-covariance sprecifications is model 1
  • In the followind example model 1 and model 6 are compared
  • Add line scale() %>% to center indicator means

Plot 3-class model

Note: single imputation is used in this example as plot_profiles() requires complete cases


Plot densities for classes k = 1:4


Which variance-covariance specification is appropriate?

In this tutorial we consider the following three models: A. equal variances and covariances fixed to zero (default) B. free variances and covariances fixed to zero (Model 2) C. free variances and free covariance for Physics and Science test scores (Model 6)


Figure. Picture adapted from lecture slides by Karen Nylund-Gibson.


Concept check 1: Equal Variances & Covariances fixed to zero

Figure. Picture of “diagonal class-invariant model” adapted from lecture slides by Karen Nylund-Gibson.


Concept check 2: Unequal Variances & Free Covariances

Figure. Picture of “non-diagonal class-varying model” adapted from lecture slides by Karen Nylund-Gibson.


B. Run enumeration specifying free variances


C. Run enumeration specifying free variances and free covariances


Compare model fit

Title Parameters LL BIC aBIC BLRT_PValue T11_VLMR_PValue
Class 1A 8 -46288.29 92640.89 92615.47 NA NA
Class 1B 8 -46288.29 92640.89 92615.47 NA NA
Class 1C 9 -42816.54 85705.44 85676.84 NA NA
Class 2A 13 -43352.36 86809.23 86767.93 0 0e+00
Class 2B 17 -43313.36 86763.40 86709.38 0 0e+00
Class 2C 19 -41021.00 82194.76 82134.39 0 0e+00
Class 3A 18 -42126.11 84396.93 84339.74 0 0e+00
Class 3B 26 -42030.92 84270.88 84188.27 0 0e+00
Class 3C 29 -40319.12 80871.40 80779.26 0 0e+00
Class 4A 23 -41433.72 83052.37 82979.29 0 0e+00
Class 4B 35 -41324.70 82930.80 82819.59 0 2e-04
Class 4C NA NA NA NA NA NA

References

Hallquist, M. N., & Wiley, J. F. (2018). MplusAutomation: An R Package for Facilitating Large-Scale Latent Variable Analyses in Mplus. Structural equation modeling: a multidisciplinary journal, 25(4), 621-638.

Miller, J. D., Hoffer, T., Suchner, R., Brown, K., & Nelson, C. (1992). LSAY codebook. Northern Illinois University.

Muthén, B. O., Muthén, L. K., & Asparouhov, T. (2017). Regression and mediation analysis using Mplus. Los Angeles, CA: Muthén & Muthén.

Muthén, L.K. and Muthén, B.O. (1998-2017). Mplus User’s Guide. Eighth Edition. Los Angeles, CA: Muthén & Muthén

Rosenberg, J. M., van Lissa, C. J., Beymer, P. N., Anderson, D. J., Schell, M. J. & Schmidt, J. A. (2019). tidyLPA: Easily carry out Latent Profile Analysis (LPA) using open-source or commercial software [R package]. https://data-edu.github.io/tidyLPA/

R Core Team (2017). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL http://www.R-project.org/

Wickham et al., (2019). Welcome to the tidyverse. Journal of Open Source Software, 4(43), 1686, https://doi.org/10.21105/joss.01686


 

A work by Adam Garber

agarber@ucsb.edu