Learn R Programming

LCPA (version 1.0.1)

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.1

License

GPL-3

Maintainer

Haijiang Qin

Last Published

February 27th, 2026

Functions in LCPA (1.0.1)

LRT.test

Likelihood Ratio Test
check.response

Validate response matrix against expected polytomous category counts
LRT.test.VLMR

Lo-Mendell-Rubin likelihood ratio test
LRT.test.Bootstrap

Bootstrap Likelihood Ratio Test
adjust.response

Adjust Categorical Response Data for Polytomous Items
LCPA

Latent Class/Profile Analysis with Covariates
LPA

Fit Latent Profile Analysis
LCA

Fit Latent Class Analysis Models
Kmeans.LCA

Initialize LCA Parameters via K-means Clustering
LTA

Latent Transition Analysis (LTA)
get.Log.Lik.LCA

Calculate Log-Likelihood for Latent Class Analysis
extract

S3 Methods: extract
get.P.Z.Xn.LPA

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

Compute Classification Error Probability (CEP) Matrices
get.SE

Compute Standard Errors
get.Log.Lik.LPA

Calculate Log-Likelihood for Latent Profile Analysis
get.AvePP

Calculate Average Posterior Probability (AvePP)
compare.model

Model Comparison Tool
get.Log.Lik.LTA

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

Compute Posterior Latent Class Probabilities Based on Fixed Parameters
get.npar.LCA

Calculate Number of Free Parameters in Latent Class Analysis
get.entropy

Calculate Classification Entropy
normalize

Column-wise Z-Score Standardization
get.npar.LTA

Calculate Number of Free Parameters in Latent Transition Analysis
logit

Compute the Logistic (Sigmoid) Function
install_python_dependencies

Install Required Python Dependencies for Neural Latent Variable Models
print

S3 Methods: print
get.npar.LPA

Calculate Number of Free Parameters in Latent Profile Analysis
plotResponse

Visualize Response Distributions with Density Plots
get.fit.index

Calculate Fit Indices
summary

S3 Methods: summary
sim.correlation

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

Simulate Data for Latent Profile Analysis
sim.LTA

Simulate Data for Latent Transition Analysis (LTA)
sim.LCA

Simulate Data for Latent Class Analysis
update

S3 Methods: update
rdirichlet

Generate Random Samples from the Dirichlet Distribution