An online machine learning model for predicting medication adherence in hypertensive patients: data from the China health and retirement longitudinal study (CHARLS)
摘要
Hypertension, a leading global cause of death with high prevalence and poor control, faces a critical issue of poor medication adherence. Existing predictive models for medication adherence suffer from limitations such as small sample sizes, insufficient inclusion of multiple factors, and a lack of nationally representative longitudinal data on the Chinese population.
AimThis study aimed to develop an interpretable machine learning model for predicting medication adherence among Chinese hypertensive patients.
MethodUsing data from the China Health and Retirement Longitudinal Study, we categorized medication adherence as “high” or “low” based on consistency across two survey waves. Predictors included demographics, physical/psychological capability, motivation, and social-environmental factors. After missing data imputation via random forest, feature selection was performed using least absolute shrinkage and selection operator regression. Seven machine learning algorithms were trained and evaluated, with interpretability provided by Shapley additive explanations (SHAP) analysis. A Shiny-based web application was developed for model visualization and functions.
ResultsAmong 2773 hypertensive patients aged ≥ 45 years, 53.2% had low medication adherence. XGBoost performed best (area under the receiver operating characteristic curve = 0.828, accuracy = 0.726, F1-score = 0.713) in the test set. SHAP analysis indicated that better adherence was associated with the presence of multiple chronic conditions, overweight or obesity, cardiometabolic multimorbidity, older age, depression, residence in an urban area, sleep duration exceeding 8 h, a lack of bidirectional financial support, and disability in instrumental activities of daily living. In contrast, residence in the western region, smoking, and being employed were associated with non-adherence. The developed online tool provided real-time, personalized risk assessments, with predictions made interpretable via the SHAP framework to quantify key factors’ contributions and offer transparent decision support.
ConclusionThis study developed an XGBoost machine learning model and online tool to predict medication adherence in Chinese hypertensive patients. The tool provided immediately actionable and transparent risk stratification, enabling targeted intervention. Future research should perform external validation of the model using electronic medical records or objective adherence data, thereby enhancing its generalizability and practical utility.