Source-linked AI summary
Estimation of extended mixed models using latent classes and latent processes: the R package lcmm
Cécile Proust-Lima, Viviane Philipps, Benoit Liquet
TL;DR
Longitudinal cognitive-aging data can involve non-Gaussian outcomes, latent processes, event times, and unobserved population heterogeneity. The paper presents lcmm, an R package implementing mixed, latent-process, latent-class, multivariate, and joint models with estimation and post-fit tools. In examples, joint models improved predictive ability over a one-class survival model, while latent-class estimation required repeated initializations because global likelihood maximization was not guaranteed.
Problem
Longitudinal data may combine non-Gaussian outcomes, latent processes, event times, and unobserved heterogeneity that exceed standard mixed-model settings.
Method
The lcmm package implements mixed, latent-process, multivariate, latent-class, and joint latent class models with maximum-likelihood estimation and post-fit analyses.
Results
Joint models for normMMSE change and dementia incidence had better predictive ability than a one-class dementia survival model; three- and four-class models had similar predictive accuracy after age 80.
Takeaways & Limitations
lcmm provides a unified R implementation for modeling complex longitudinal outcomes, heterogeneous trajectories, and longitudinal-event relationships.
Takeaways & Limitations
Mixture-model likelihoods may have multiple maxima, so convergence to the global maximum is not ensured from a single initialization.
Abstract
from arXiv · showhide
The R package lcmm provides a series of functions to estimate statistical models based on linear mixed model theory. It includes the estimation of mixed models and latent class mixed models for Gaussian longitudinal outcomes (hlme), curvilinear and ordinal univariate longitudinal outcomes (lcmm) and curvilinear multivariate outcomes (multlcmm), as well as joint latent class mixed models (Jointlcmm) for a (Gaussian or curvilinear) longitudinal outcome and a time-to-event that can be possibly left-truncated right-censored and defined in a competing setting. Maximum likelihood esimators are obtained using a modified Marquardt algorithm with strict convergence criteria based on the parameters and likelihood stability, and on the negativity of the second derivatives. The package also provides various post-fit functions including goodness-of-fit analyses, classification, plots, predicted trajectories, individual dynamic prediction of the event and predictive accuracy assessment. This paper constitutes a companion paper to the package by introducing each family of models, the estimation technique, some implementation details and giving examples through a dataset on cognitive aging.
1. Introduction
The paper motivates extensions of linear mixed models for longitudinal data whose outcomes, latent processes, event times, and population trajectories may be complex. It introduces lcmm as an R package addressing these extensions through latent classes, latent processes, joint models, estimation procedures, and post-fit analyses.
- Motivation: Cognitive aging combines non-Gaussian, bounded or ordinal measurements with an underlying cognitive process that is not directly observed.Cognition is measured through repeated psychometric tests, which may be sumscores, items, ratios, or ordinal variables.
- Motivation: Longitudinal cognitive decline may need joint modeling with dementia onset and death because these events are strongly associated with the cognitive process.
- Motivation: Elderly populations may contain latent groups with different cognitive trajectories, such as normal aging and pathological aging toward dementia.
- Contribution: The lcmm package provides estimation functions for extensions of linear mixed models involving latent classes, latent processes, and joint models.
- Contribution: Its four main estimation functions are hlme, lcmm, multlcmm, and Jointlcmm, supplemented by goodness-of-fit, predictive-accuracy, output, and prediction functions.
- Organization: The paper defines the implemented models, explains their estimation and implementation, presents post-fit analyses, and illustrates them with the paquid dataset.
2. Extended mixed models
The package extends linear mixed models to latent-process, multivariate, and latent-class settings for longitudinal outcomes and heterogeneous populations. These extensions use flexible measurement models, stochastic processes, and class-specific trajectory structures.
- Model families: The package covers standard, non-Gaussian, multivariate, latent-class, and joint latent class mixed models.
- Linear mixed model: Measurement times and numbers of observations may vary between subjects, allowing intermittent missingness, dropout, and actual rather than planned visit times.
- Linear mixed model: A linear mixed model represents subject trajectories with fixed effects, random effects, Gaussian measurement errors, and an optional Gaussian stochastic process.
- Latent process mixed model: Latent process mixed models separate a continuous underlying process from observations through a flexible nonlinear measurement model.
- Latent process mixed model: The measurement model supports linear, rescaled Beta CDF, I-spline, and cumulative probit links for quantitative, ordinal, or binary markers.
- Multivariate extension: Multivariate latent process models treat the latent process as a common factor generating multiple markers with marker-specific links, contrasts, and measurement errors.
- Latent class extension: Latent class mixed models represent heterogeneous populations as G latent classes with distinct mean trajectory profiles.
3. Estimation
The package estimates homogeneous and latent-class extensions of mixed models by maximizing individual-contribution likelihoods across Gaussian, latent-process, multivariate, and joint longitudinal–survival settings. Estimation uses an extended Marquardt algorithm with numerical integration for random-effects likelihoods and simultaneous convergence checks.
- Likelihood construction: Maximum likelihood estimation uses the summed log-likelihood of individual model contributions, with G=1 for homogeneous models and fixed G for latent-class models.Each individual contribution depends on the model family, while latent classes introduce class-specific parameters and membership probabilities.
- Likelihood construction: Linear mixed-model contributions use multivariate normal densities with fixed-effects means and variance combining random effects, stochastic processes, and measurement error.The covariance structure includes ZiBZ⊤i, the stochastic-process covariance Ri, and measurement-error variance.
- Model-specific likelihoods: Continuous latent-process models multiply the multivariate normal density by the Jacobian determinant of the inverse link function, whereas ordinal models use Gaussian-CDF probability differences conditional on random effects.The continuous links include linear, rescaled Beta CDF, and quadratic I-spline transformations; ordinal models currently omit the stochastic process.
- Model-specific likelihoods: Multivariate latent-process models currently support only continuous links and construct a joint multivariate normal contribution across markers with shared process covariance and block-diagonal measurement-error covariance.The model defines marker-specific means and design matrices while evaluating the stochastic process at all observed marker times.
- Model-specific likelihoods: Latent-class mixed-model contributions combine class-membership probabilities with class-specific multivariate normal densities, and latent-process extensions replace those densities with class-specific model contributions.Joint latent-class models additionally combine longitudinal contributions with cause-specific hazards and cumulative hazards, including left-truncation adjustment through survival.
- Optimization and convergence: The extended Marquardt algorithm updates parameters with a diagonal-inflated Hessian, modifies the step when needed to improve log-likelihood, and computes derivatives by finite differences.Random-effects integrals use 30-point univariate Gauss-Hermite quadrature for one random effect and multivariate Gauss-Hermite quadrature otherwise.
- Optimization and convergence: Convergence requires simultaneous parameter, likelihood, and derivative criteria, with default thresholds ϵa=ϵb=ϵd=10−4; the MLE variance-covariance matrix is estimated from the inverse Hessian.The derivative criterion is intended to prevent premature convergence in complex models with relatively flat likelihood regions.
4. Implementation
The implementation provides four estimation functions for mixed, latent-process, multivariate, and joint latent class models, supported by Fortran programs, configurable model calls, and post-fit functionality. Mixture models require careful initialization because likelihood maximization can converge to local rather than global maxima.
- Estimation functions: Four estimation functions cover linear mixed models, univariate latent-process models, multivariate latent-process models, and joint latent class mixed models.They are implemented through hlme, lcmm, multlcmm, and Jointlcmm or its shortcut jlcmm.
- Implementation: The estimation programs for all four functions are written in Fortran 90 and include log-likelihood computation and optimization.
- Model specification: Model calls specify fixed and random effects, subjects, latent classes, class-specific effects, covariance structures, stochastic processes, data handling, and optimization controls.The hlme interface includes arguments for latent-class membership, initial values, fixed parameters, convergence thresholds, and iteration limits.
- Latent-process models: The lcmm function extends the common call structure with linear, Beta-CDF, threshold, or spline link functions for non-Gaussian longitudinal outcomes.Spline links allow control over knot placement and the number of values used to compute the estimated link function.
- Multivariate and joint models: The multlcmm and Jointlcmm interfaces add multivariate marker specifications and class-specific survival-model arguments, respectively.Jointlcmm supports survival formulas, cause-specific effects, and hazard specifications alongside longitudinal modeling.
- Initialization: Mixture models may have multiple likelihood maxima, so repeated runs from different initial-value sets are recommended to improve the chance of reaching the global maximum.Automatic initial values do not ensure convergence to the global maximum and may be inappropriate for a specific analysis.
5. Post-fit computations
The package supplies post-fit outputs for inference, covariance estimation, parameter testing, and posterior latent-class probabilities. These functions support model assessment and classification using maximum-likelihood results.
- Post-fit framework: Post-fit analyses are available across hlme, lcmm, multlcmm, and Jointlcmm objects.
- Inference: The summary and estimates functions provide maximum-likelihood estimates with estimated standard errors, while VarCov returns their estimated variance-covariance matrix.The covariance matrix is also available in output value V.
- Inference: Variance-covariance parameters for random effects are estimated through Cholesky parameters, with their standard errors computed by VarCovRE.
- Inference: WaldMult performs univariate and multivariate Wald tests for parameter combinations from all four model classes.
- Classification: Latent-class models compute posterior class-membership probabilities using Bayes theorem from the observed information and fitted parameters.In joint latent-class models, the time-to-event is included in the complete information used for posterior probabilities.
- Classification: Subjects can be assigned to the latent class with the highest posterior probability, with probabilities and classifications reported in model-specific output tables.Jointlcmm additionally provides pprobY based only on the longitudinal model.
Posterior classification
Posterior classification evaluates how clearly subjects are separated among latent classes and can inform model goodness-of-fit and class-number selection. The package reports threshold-based proportions and a posterior classification table.
- Uses: Posterior classification supports goodness-of-fit assessment, latent-class discrimination, and selection of the number of latent classes.
- Classification indicators: The package reports the proportion of subjects in each class whose posterior probability exceeds 0.7, 0.8, and 0.9.These proportions indicate how many subjects are not ambiguously classified within each class.
- Classification indicators: The posterior classification table gives mean probabilities of class membership among subjects assigned a posteriori to each class.Perfect classification has ones on the diagonal and zeros elsewhere, while high diagonal values indicate good population discrimination.
- Related outputs: Empirical Bayes estimates and longitudinal predictions are naturally derived from the linear mixed model framework used by all four estimation functions.
- Related outputs: For continuous-link latent-process models, random effects are predicted on the latent-process scale using transformed marker values.In multivariate models, the transformation is applied across markers before prediction.
- Related outputs: With latent classes, class-specific empirical Bayes estimates are computed and marginal estimates are obtained by averaging across classes using posterior probabilities.
Longitudinal predictions and residuals
The package computes marginal, subject-specific, and class-specific predictions and residuals for its longitudinal models. Plotting functions visualize residuals or fitted trajectories, with class-specific curves weighted by class-membership probabilities.
- Predictions and residuals: All four estimation functions provide longitudinal predictions and residuals through the pred output table.Both subject-specific and marginal quantities are computed.
- Observed-outcome scale: For hlme and Jointlcmm without a link function, predictions and residuals are reported on the observed outcome scale.
- Latent classes: For models with more than one class, class-specific predictions are averaged over latent classes to compute marginal predictions and residuals.
- Latent-process scale: For lcmm, multlcmm, and linked Jointlcmm models, marginal and subject-specific predictions are computed on the latent-process scale.For multlcmm, predictions are also provided for each marker.
- Latent-process scale: The pred table contains transformed observations for linked lcmm and multlcmm outputs.
- Visualization: The plot function displays marginal and subject-specific residuals or fitted mean evolutions with observed class-specific means and 95% confidence bounds.When G > 1, class-specific mean evolutions are weighted by class-membership probabilities.
Special case of longitudinal predictions in the marker scale for latent process mixed models
For latent process mixed models, fitY computes marginal longitudinal predictions on the marker scale by integrating the link-transformed latent process over the random-effects distribution, conditionally by latent class when needed.
- fitY computes marginal longitudinal predictions on the marker scale for Jointlcmm, multlcmm, and lcmm models with continuous link functions.
- For one latent class, predictions use numerical integration of the estimated link function over the multivariate Gaussian distribution of the latent process.
- For multiple latent classes, the same prediction method is applied conditionally within each latent class.
- Newton algorithms compute link-function values, while Monte Carlo methods manage the numerical integrations.
- For lcmm models with threshold links, marginal longitudinal predictions are computed using the Gaussian cumulative distribution function.
Predicted mean trajectory according to a profile of covariates
The package predicts mean marker trajectories for hypothetical covariate profiles and can quantify uncertainty by Monte Carlo sampling from the asymptotic parameter distribution.
- predictY and its plot method compute and represent predicted mean marker trajectories for hypothetical covariate profiles.
- Predictions for a new hypothetical subject use covariate information supplied in a table for the model’s required design matrices.
- For hlme and Jointlcmm, the predicted mean vector is the class-specific marginal prediction vector.
- Monte Carlo draws from N(θ̂G, V(θ̂G)) approximate the posterior prediction distribution around the point estimate.
5.4. Link functions
The package supports link-function inspection, dynamic event prediction, and class-specific survival or incidence prediction for latent process and joint latent class models.
- 5.4. Link functions: The link-function section covers lcmm, multlcmm, and Jointlcmm models with non-null links.
- 5.4. Link functions: estimlink computes estimated inverse link functions at maximum likelihood, while plot and predictlink visualize them and their Monte Carlo uncertainty.
- 5.4. Link functions: For ordinal outcomes with many levels, continuous-link latent process models approximate cumulative probit mixed models and should be assessed using discrete log-likelihood criteria.
- Jointlcmm predictions: Jointlcmm plots class-specific baseline risks and survival functions, or computes cause-specific cumulative incidences for competing events and covariate profiles.
- Jointlcmm predictions: dynpred estimates an individual’s probability of an event in (s, s + t] using longitudinal information observed through landmark time s.
- Jointlcmm predictions: With multiple causes, cumulative-incidence integration uses 50-point Gauss-Legendre quadrature.
Assessment of predictive accuracy
The package assesses dynamic-prediction accuracy through prognostic information criteria, cross-validation, model comparisons, and time-dependent ROC analyses.
- EPOCE evaluates Jointlcmm dynamic predictions using subjects at risk at landmark times and their biomarker histories up to those times.
- On external data, epoce reports MPOL at each landmark time; on estimation data, it also reports CVPOL.
- CVPOL uses approximate cross-validation to correct MPOL for possible over-optimism.
- Diffepoce compares two models by estimating differences in EPOCE together with a 95% tracking interval.
- timeROC provides additional predictive-accuracy measures from individual dynamic predictions computed by dynpred.
6. Examples
Examples using the paquid cognitive-aging dataset demonstrate model estimation, latent-class selection, post-fit assessment, and joint longitudinal-survival analysis with lcmm.
- The paquid dataset contains 500 subjects with repeated cognitive, dependency, and depression measurements collected over up to 20 years.
- Heterogenous linear mixed model: The hlme examples model quadratic normalized-MMSE trajectories with age, CEP adjustment, and correlated random effects, then compare models with one, two, and three latent classes.
- Heterogenous linear mixed model: The two-class hlme model is selected by BIC, assigning 62 subjects to class 1 and 438 to class 2 with mean posterior probabilities of 80.5% and 87.3%.
- Latent process models explain 26%–42% of marker variance at time 0 and 38%–56% after 5 years.
- Joint latent class examples show that the four-class model has the lowest BIC, while three- and four-class models have similar predictive accuracy after age 80.
- Jointlcmm summaries combine longitudinal, survival, and conditional-independence information, with classification mean posterior probabilities above 71% and up to 88.7%.
7. Concluding remarks
lcmm extends linear mixed-model methods to nonlinear, multivariate, latent-class, and joint-model settings, including scales with asymmetric distributions and unequal interval scaling. The authors position it as addressing model families not otherwise supported by available programs, while noting that estimation can remain computationally long.
- lcmm extends linear mixed models to nonlinear, multivariate, latent-class, and joint-model settings.
- The latent process mixed model targets asymmetric scales with ceiling or floor effects and unequal interval scaling.
- The authors report no other programs estimating general multivariate latent process mixed models or joint latent class mixed models.
- Further development is planned for parallel computation because estimation may still be long despite computationally efficient Fortran 90 code.