🤖 AI Summary
Irregular and heterogeneous longitudinal biometric trajectories in electronic health records (EHRs) pose challenges for robust phenotyping and cross-institutional analysis.
Method: We propose a cross-platform analytical framework integrating thin-plate spline regression for asynchronous time-series smoothing with k-means clustering for clinical phenotype identification. The method ensures algorithmic consistency and reproducibility across R and SAS implementations, augmented by multi-core parallelization, joint evaluation using the Adjusted Rand Index and silhouette coefficient, and flexible parameter tuning with integrated visualization.
Results: Validation on simulated blood pressure data demonstrates high inter-platform clustering concordance (Adjusted Rand Index > 0.95), substantially enhancing modeling robustness for irregular longitudinal data and compatibility across heterogeneous EHR systems. This framework provides a generalizable, scalable, and reproducible technical foundation for multi-platform EHR phenotyping studies.
📝 Abstract
Background and Objective: Variables collected over time, or longitudinally, such as biologic measurements in electronic health records data, are not simple to summarize with a single time-point, and thus can be more holistically conceptualized as trajectories over time. Cluster analysis with longitudinal data further allows for clinical representation of groups of subjects with similar trajectories and identification of unique characteristics, or phenotypes, that can be investigated as risk factors or disease outcomes. Some of the challenges in estimating these clustered trajectories lie in the handling of observations at inconsistent time intervals and the usability of algorithms across programming languages.
Methods: We propose longitudinal trajectory clustering using a k-means algorithm with thin-plate regression splines, implemented across multiple platforms, the R package clustra and corresponding SAS macros. The SAS macros accommodate flexible clustering approaches, and also include visualization of the clusters, and silhouette plots for diagnostic evaluation of the appropriate cluster number. The R package, designed in parallel, has similar functionality, with additional multi-core processing and Rand-index-based diagnostics.
Results: The package and macros achieve comparable results when applied to an example of simulated blood pressure measurements based on real data from Veterans Affairs Healthcare recipients who were initiated on anti-hypertensive medication.
Conclusion: The R package clustra and the SAS macros integrate a K-means clustering algorithm for longitudinal trajectories that operates with large electronic health record data. The implementations provide comparable results in both platforms, satisfying the needs of investigators familiar with, or constrained by access to, one or the other platform.