Learn R Programming

LCPA (version 1.0.0)

A General Framework for Latent Classify and Profile Analysis

Description

A unified latent class modeling framework that encompasses both latent class analysis (LCA) and latent profile analysis (LPA), offering a one-stop solution for latent class modeling. It implements state-of-the-art parameter estimation methods, including the expectation–maximization (EM) algorithm, neural network estimation (NNE; requires users to have 'Python' and its dependent libraries installed on their computer), and integration with 'Mplus' (requires users to have 'Mplus' installed on their computer). In addition, it provides commonly used model fit indices such as the Akaike information criterion (AIC) and Bayesian information criterion (BIC), as well as classification accuracy measures such as entropy. The package also includes fully functional likelihood ratio tests (LRT) and bootstrap likelihood ratio tests (BLRT) to facilitate model comparison, along with bootstrap-based and observed information matrix-based standard error estimation. Furthermore, it supports the standard three-step approach for LCA, LPA, and latent transition analysis (LTA) with covariates, enabling detailed covariate analysis. Finally, it includes several user-friendly auxiliary functions to enhance interactive usability.

Copy Link

Version

Install

install.packages('LCPA')

Version

1.0.0

License

GPL-3

Maintainer

Haijiang Qin

Last Published

January 22nd, 2026

Functions in LCPA (1.0.0)

LRT.test.Bootstrap

Bootstrap Likelihood Ratio Test
LRT.test.VLMR

Lo-Mendell-Rubin likelihood ratio test
LCA

Fit Latent Class Analysis Models
Kmeans.LCA

Initialize LCA Parameters via K-means Clustering
LPA

Fit Latent Profile Analysis
LCPA

Latent Class/Profile Analysis with Covariates
LRT.test

Likelihood Ratio Test
check.response

Validate response matrix against expected polytomous category counts
LTA

Latent Transition Analysis (LTA)
adjust.response

Adjust Categorical Response Data for Polytomous Items
get.CEP

Compute Classification Error Probability (CEP) Matrices
get.Log.Lik.LTA

Calculate Log-Likelihood for Latent Transition Analysis
compare.model

Model Comparison Tool
get.Log.Lik.LCA

Calculate Log-Likelihood for Latent Class Analysis
get.Log.Lik.LPA

Calculate Log-Likelihood for Latent Profile Analysis
get.P.Z.Xn.LCA

Compute Posterior Latent Class Probabilities Based on Fixed Parameters
get.P.Z.Xn.LPA

Compute Posterior Latent Profile Probabilities Based on Fixed Parameters
get.SE

Compute Standard Errors
get.AvePP

Calculate Average Posterior Probability (AvePP)
extract

S3 Methods: extract
get.npar.LPA

Calculate Number of Free Parameters in Latent Profile Analysis
logit

Compute the Logistic (Sigmoid) Function
get.entropy

Calculate Classification Entropy
install_python_dependencies

Install Required Python Dependencies for Neural Latent Variable Models
normalize

Column-wise Z-Score Standardization
get.fit.index

Calculate Fit Indices
get.npar.LTA

Calculate Number of Free Parameters in Latent Transition Analysis
get.npar.LCA

Calculate Number of Free Parameters in Latent Class Analysis
plotResponse

Visualize Response Distributions with Density Plots
print

S3 Methods: print
sim.correlation

Generate a Random Correlation Matrix via C-Vine Partial Correlations
sim.LCA

Simulate Data for Latent Class Analysis
summary

S3 Methods: summary
update

S3 Methods: update
rdirichlet

Generate Random Samples from the Dirichlet Distribution
sim.LPA

Simulate Data for Latent Profile Analysis
sim.LTA

Simulate Data for Latent Transition Analysis (LTA)