Abstract
Efficient R package for latent class analysis of recurrent events, based on the semiparametric multiplicative intensity model by Zhao et al. (2022). SLCARE returns estimates for non-functional model parameters along with the associated variance estimates and p-values. Visualization tools are provided to depict the estimated functional model parameters and related functional quantities of interest. SLCARE also delivers a model checking plot to help assess the adequacy of the fitted model.
Introduction
In longitudinal clinical studies, researchers often encounter "recurrent events"—repeated occurrences of a specific medical event over time, such as tumor recurrences, hospital readmissions, or infections. A significant challenge in analyzing this data is unobserved heterogeneity: the presence of hidden subgroups (latent classes) within the population that may exhibit different baseline risks or respond differently to treatments. Standard statistical models frequently overlook these nuances, assuming population homogeneity or relying on observed covariates alone.
SLCARE is a new R package designed to address this gap. By implementing the semiparametric multiplicative intensity model proposed by Zhao et al. (2022), it allows for the identification of these latent classes without requiring rigid parametric assumptions about event timing. This flexibility makes it a powerful tool for uncovering hidden patterns in complex event data.
Methodology
The core of the package is a semiparametric multiplicative intensity model that balances statistical rigor with practical flexibility. Key features include:
- Latent Class Membership: The probability of a subject belonging to a specific class is determined via logistic regression based on baseline covariates.
- Intensity Function: The rate of event occurrence is modeled as a product of the subject's latent class, an unspecified (semiparametric) baseline intensity function, and optional subject-specific "frailty" (random effects).
- Automated Initialization: To overcome the sensitivity of latent class models to starting values, SLCARE includes an automated initializer using K-means clustering and multinomial regression to ensure reliable estimation.
- Frailty Modeling: Users can account for subject-specific variance by choosing between a model with no frailty or one where frailty follows a Gamma distribution.
- Inference: The package provides point estimates, bootstrap-based standard errors, and p-values for all non-functional model parameters.
Datasets
The package includes two primary datasets to demonstrate its functionality. The first, colorectal, is derived from the FFCD 2000-05 multicenter phase III clinical trial. It tracks 150 patients, recording the appearance of new metastatic lesions and death alongside baseline characteristics like age and treatment arm.
Additionally, the package provides SimData, a simulated dataset containing 476 rows. This dataset is designed to showcase how the package handles a mix of binary and continuous baseline covariates in a controlled environment.
Visualization and Model Diagnostics
One of the standout features of SLCARE is its suite of visualization tools. Beyond numerical output, the package provides the plot.SLCARE function to help researchers interpret their results and validate their models.
The package supports three distinct types of visualizations:
- Cumulative Baseline Intensity (
mu0): Depicts the underlying risk over time for each latent class. - Class-Specific Mean Functions (
EstMeans): Shows the expected number of events over time for different subgroups. - Model Checking Plot (
ModelChecking): A diagnostic tool that compares observed recurrent events against expected events. Significant deviations from the identity line indicate potential model mis-specification, allowing researchers to refine their analysis.
Furthermore, the predict function enables posterior prediction of event counts for individuals, facilitating personalized risk assessment and clinical decision-making.
Conclusion and Future Work
SLCARE provides a robust, user-friendly framework for semiparametric latent class analysis. While highly efficient, users should note that latent class models—particularly those utilizing bootstrap standard errors—can be computationally intensive for very large datasets. Future iterations of the package may expand to include alternative frailty distributions beyond the Gamma distribution and more automated methods for determining the optimal number of latent classes ($K$), which currently relies on iterative testing and relative entropy metrics.
Summary updated