Introduction
Installation
Examples
References
This is a package built on top of utilities provided by the poLCA package.
Latent class analysis (LCA) or Latent profile analysis (LPA), which uses a parametric model to place respondents into classes (or clusters) based on their response patterns. In LPA, the number of classes is determined by the expectation-maximization algorithm which involves an iterative process until the model converges on a best fit for the data. This involves the notion that there should be shared variance within the clusters, and that clusters should be empirically distinct from each other. For more detailed introduction to the method, please refer here
LCA has been extensively used in social science however it is poorly implemented in R compared with its counterparts Mplus or STATA.
The poLCA package only offers the following 3D plots:
This package aims to bridge the gap by providing additional plotting functions to better understand the model restuls.
Acknowledgement: Please note that you have to use poLCA package to fit the latent model and the model object would be like following:
Please install from github:
devtools::install_github("DavidykZhao/LCA_plotter")
In the example, I used the dataset of the World Value Survey wave 5. I have cleaned the data and it could be found in the materials folder. This data set contains data from 22 countries on their attitudes towards 6 democracy related questions. Profile plot
library(poLCA)
# Define a formula for the LDA modeling
formula = with(data, cbind(tax, religion, free_election, state_aid, civil_rights, women)~1)
profile_plot(data, num_var, f) # This will yield the plot
For more detailed introduction to the package, please refer here for more details.
If you encounter any issue with the package, please feel free to file and issue.
Latent class modeling in STATA
Latent class modeling in Mplus
A good blogpost on the use of poLCA package