[Paper Review] LMest: an R package for latent Markov models for categorical longitudinal data
This paper introduces LMest, an R package for fitting latent Markov (LM) models to categorical longitudinal data, using the expectation-maximization algorithm with forward-backward recursions. It enables estimation of LM models with individual covariates in both measurement and latent processes, supports mixed LM models with random effects, and provides standard errors and decoding options, offering a flexible tool for analyzing unobserved heterogeneity and time-varying unobserved traits in social, medical, and behavioral research.
Latent Markov (LM) models represent an important class of models for the analysis of longitudinal data (Bartolucci et. al., 2013), especially when response variables are categorical. These models have a great potential of application for the analysis of social, medical, and behavioral data as well as in other disciplines. We propose the R package LMest, which is tailored to deal with these types of model. In particular, we consider a general framework for extended LM models by including individual covariates and by formulating a mixed approach to take into account additional dependence structures in the data. Such extensions lead to a very flexible class of models, which allows us to fit different types of longitudinal data. Model parameters are estimated through the expectation-maximization algorithm, based on the forward-backward recursions, which is implemented in the main functions of the package. The package also allows us to perform local and global decoding and to obtain standard errors for the parameter estimates. We illustrate its use and the most important features on the basis of examples involving applications in health and criminology.
Motivation & Objective
- To develop an R package that enables efficient estimation of latent Markov models for categorical longitudinal data.
- To extend existing models by incorporating individual covariates in both the measurement and latent process components.
- To support mixed latent Markov models with random effects to account for additional dependence structures.
- To provide accurate standard errors for parameter estimates using the observed information matrix.
- To facilitate local and global decoding of latent states for interpretability and model diagnostics.
Proposed method
- Uses the expectation-maximization (EM) algorithm with forward-backward recursions for maximum likelihood estimation.
- Applies efficient parameterizations to include individual covariates in the measurement model or the latent Markov chain.
- Implements a mixed LM model formulation by introducing random effects to capture unobserved heterogeneity.
- Employs Fortran routines to enhance computational efficiency and reduce time consumption.
- Computes standard errors via exact or reliable approximations of the observed information matrix.
- Supports both univariate and multivariate categorical outcomes in model estimation.
Experimental results
Research questions
- RQ1How can latent Markov models be extended to include individual covariates affecting the response or latent process in longitudinal categorical data?
- RQ2What is the performance and accuracy of parameter estimation in mixed latent Markov models with random effects?
- RQ3How can standard errors for parameter estimates be reliably computed in complex LM models?
- RQ4What is the interpretability of latent states in real-world applications such as health and criminology?
- RQ5How does the LMest package compare in efficiency and functionality to existing R packages for hidden Markov models?
Key findings
- The LMest package successfully estimates latent Markov models with individual covariates in both measurement and latent process models, enabling flexible modeling of time-varying unobserved traits.
- The estimated conditional probability of committing crimes showed that the second latent state (18.2% of females) was associated with high tendencies toward theft and burglary, while the first state (81.8%) had near-zero crime propensity.
- Females in the first cluster (22%) had a 64% probability of transitioning from the second to the first latent state, compared to 34% in the second cluster, indicating stronger behavioral improvement in the first group.
- The model revealed high persistence in the first latent state within both clusters, with transition probabilities from state 1 to itself exceeding 0.99 in most time points.
- Standard errors for parameter estimates were computed via reliable approximations of the observed information matrix, enhancing model inference.
- The package supports multivariate categorical outcomes and provides efficient decoding and prediction tools, with future updates planned for continuous outcomes and informative missing data handling.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.