Predicting Health-Related Quality of Life Among Patients With Type 2 Diabetes Using Random Forest and SHAP-Based Feature Importance Analysis

Authors

    Karl Põder Department of Cognitive Psychology, University of Tartu, Tartu, Estonia
    Ana Lucía Martínez * Department of Psychology, National Autonomous University of Mexico (UNAM), Mexico City, Mexico ana.martinez@unam.mx
https://doi.org/10.61838/sxnr2h27

Keywords:

Type 2 diabetes, health-related quality of life, Random Forest, SHAP, machine learning, self-care, depression, glycemic control

Abstract

Objective: This study aimed to predict health-related quality of life among patients with type 2 diabetes in Mexico using a Random Forest model and to identify the most influential clinical, behavioral, psychological, and sociodemographic predictors through SHAP-based feature importance analysis.

Methods and Materials: This cross-sectional predictive modeling study was conducted among 462 adult patients with type 2 diabetes receiving outpatient care in Mexico City, Guadalajara, and Monterrey. Health-related quality of life was assessed using the 36-Item Short Form Health Survey. Clinical, behavioral, psychological, and sociodemographic data were collected using medical records and standardized self-report instruments, including measures of diabetes self-care and psychological distress. The dataset was divided into training and testing subsets using an 80:20 split. A Random Forest regression model was developed to predict total health-related quality of life scores. Model performance was evaluated using the coefficient of determination, root mean square error, mean absolute error, and mean squared error. SHAP analysis was applied to interpret global feature importance and the direction of predictor effects.

Findings: The Random Forest model demonstrated strong predictive performance, explaining 73.5% of the variance in health-related quality of life in the independent testing set. The model achieved an RMSE of 8.34, MAE of 6.49, and MSE of 69.56. Cross-validation and out-of-bag estimation showed comparable performance, with R² values of 0.721 and 0.704, respectively. SHAP analysis identified depression score as the strongest predictor of lower health-related quality of life, followed by HbA1c, number of diabetes-related complications, physical activity self-care, duration of diabetes, body mass index, stress score, medication adherence, sleep duration, age, hypertension, anxiety score, foot care behavior, household income, and insulin use.

Conclusion: The findings indicate that health-related quality of life among patients with type 2 diabetes can be predicted with acceptable accuracy using Random Forest modeling, while SHAP analysis provides clinically interpretable evidence that psychological distress, glycemic control, complication burden, and self-care behaviors are central determinants of patient-perceived health.

Downloads

Download data is not yet available.

References

Algaows, F. S., Almisrea, S. N., Alshammari, F. K., Barakat, M., Alamri, A., Mesfer, A. A. S., Alahmadi, F. A., Altuwaijri, A. M., Naif, Z. A. N., Alawfi, R., Alqadeeb, M. M., & Zarnogi, D. N. (2021). Prevalence of Depression Among Type-2 Diabetic Patients-a Review. Journal of Pharmaceutical Research International, 54-60. https://doi.org/10.9734/jpri/2021/v33i40a32220

Ali, K. A. H., Adem, S., & El-Yassin, H. D. (2024). Role of Beta Trace Protein and Cystatin C as a Potential Biomarker for Early Detection of Type 2 Diabetic Nephropathy. AL-Kindy College Medical Journal, 20(1), 53-58. https://doi.org/10.47723/a2qf5d64

Banstola, P., Yadav, D. K., & Pandey, R. (2022). Assessment of Self-Care Practices, Treatment Satisfaction and Quality of Life Among Diabetes Type2 Patients in Pokhara, Nepal. Meds Alliance Journal of Medicine and Medical Sciences, 2(3), 63-69. https://doi.org/10.3126/mjmms.v2i3.47751

Chowdhury, S. R. (2022). Review the Evidence for Structured Education in Diabetes Management. Dia&Endo, 1(1). https://doi.org/10.52803/is231

Csuka, S. I., Horvát, B., Csordás, G., Lakatos, C., & Martos, T. (2025). Technology Use and Health Behavior Among Patients With Diabetes: Do Underlying Motives for Technology Adoption Matter? Frontiers in Digital Health, 7. https://doi.org/10.3389/fdgth.2025.1455261

Dai, H., & Xu, J. (2022). Creatinine-to-Cystatin C Ratio as a Marker of Sarcopenia for Identifying Osteoporosis in Male Patients With Type 2 Diabetes Mellitus. https://doi.org/10.21203/rs.3.rs-1364770/v1

Deepa, K. P., Ghafoor, N., Siraj, N., Haque, M. Z., Islam, M. U., & Jubaida, M. R. (2021). Comparison of Ocular Lens Thickness of Type-2 Diabetic Retinopathy Patients With Non-Diabetic Control, Measured by High Resolution Ultrasonography. Ibrahim Cardiac Medical Journal, 10(1-2), 40-44. https://doi.org/10.3329/icmj.v10i1-2.54002

Elshafae, M., Issa, H., moneam, A. m. A., Hafez, W. A. e., & Ahmed, E. (2020). Association Between Growth Differentiation Factor 15 and Cardiovascular Risk in Patients With Type 2 Diabetes Mellitus. Benha Medical Journal, 0(0), 0-0. https://doi.org/10.21608/bmfj.2020.108486

Emeka, E. A., Echendu, S. T., Iloh, G. U. P., Umeadi, E. N., Adinnu, K. M., Ezeude, C. M., Onwuegbuna, A. A., Ibekwe, A. M., Okafor, F. N., Egbuniwe, M. C., & Eleje, G. U. (2022). Association Between Perceived Family Support and the Control of Adult Type 2 Diabetes Mellitus in a Nigerian Tertiary Hospital. International Journal of Family Medicine & Healthcare, 1(1). https://doi.org/10.33425/2833-0382.1004

Ferdosian, H., Zamanian, H., Emami, S. A., Sedighi, E., Moridi, M., & Doustmehraban, M. (2021). Application of Artificial Intelligence in Prediction of Cardiovascular Complications in Patients With Diabetes Mellitus Type 2: A Protocol of Systematic Review. https://doi.org/10.37766/inplasy2021.10.0076

Fokkens, W. J., Corso, E. D., Hellings, P. W., Harvey, R. J., Hopkins, C., & Reitsma, S. (2024). Algorithm for the Management of Primary Diffuse Chronic Rhinosinusitis. Allergy, 80(1), 359-361. https://doi.org/10.1111/all.16417

Fokkens, W. J., Sedaghat, A. R., Soyka, M. B., & Reitsma, S. (2024). Recent Advances in Chronic Rhinosinusitis: Pathophysiology, Treatments, and Outcome Measures. Rhinology Journal, 0(0), 0-0. https://doi.org/10.4193/rhin24.801

Fujita, Y., & Inagaki, N. (2021). Cell‐autonomous Defects Contribute to Insulin Resistance in Skeletal Muscle. Journal of Diabetes Investigation, 12(7), 1136-1137. https://doi.org/10.1111/jdi.13557

Gaffari-fam, S., Lotfi, Y., Daemi, A., Babazadeh, T., Sarbazi, E., Abbasabad, G. D., & Abri, H. (2020). Impact of Health Literacy and Self-Care Behaviors on Health-Related Quality of Life in Iranians With Type 2 Diabetes: A Cross-Sectional Study. https://doi.org/10.21203/rs.3.rs-24026/v1

Maes, M., Vojdani, A., Sirivichayakul, S., Barbosa, D. S., & Kanchanatawan, B. (2020). Inflammatory and Oxidative Pathways Are New Drug Targets in Multiple Episode Schizophrenia and Leaky Gut, &Lt;em>Klebsiella Pneumoniae</Em>, and C1q Immune Complexes Are Additional Drug Targets in First eEpisode Schizophrenia. https://doi.org/10.20944/preprints202012.0457.v1

Mahwi, T., & Hassan, S. (2022). Prevalence of Low Free Testosterone Level in Men With Type 2 Diabetes Mellitus. Journal of Sulaimani Medical College, 12(3), 289-295. https://doi.org/10.17656/jsmc.10371

Mansour, A., Abdelmoniem, R. O., Elbadawy, A., & Ibrahim, W. M. (2023). The Utility of Estimation of Glomerular Filtration Rate by Serum Cystatin C as A predictor of Diabetic Kidney Disease in Both Type I and Type II Diabetic Patients: A Single Center study. The Egyptian Journal of Internal Medicine, 35(1). https://doi.org/10.1186/s43162-023-00243-y

Mouriño-Álvarez, L., Corbacho-Alonso, N., Sastre-Oliva, T., Corros-Vicente, C., Solı́s, J., Tejerina, T., Padial, L. R., & Barderas, M. G. (2021). Diabetes Mellitus and Its Implications in Aortic Stenosis Patients. International Journal of Molecular Sciences, 22(12), 6212. https://doi.org/10.3390/ijms22126212

Nshimirimana, D. A., Kokonya, D., Gitaka, J., Wesonga, B., Nzioki, J. M., & Rukanikigitero, J. M. V. (2023). Impact of COVID-19 on Health-Related Quality of Life in the General Population: A Systematic Review and Meta-Analysis. Plos Global Public Health, 3(10), e0002137. https://doi.org/10.1371/journal.pgph.0002137

Oishi, K., Matsunaga, K., Shirai, T., Hirai, K., & Gon, Y. (2020). Role of Type2 Inflammatory Biomarkers in Chronic Obstructive Pulmonary Disease. Journal of clinical medicine, 9(8), 2670. https://doi.org/10.3390/jcm9082670

Olumodeji, A. M., Adebara, I., Adewara, O. E., Adeniyi, A. A., Awoyinka, S. B., Adeyemo, O. T., Ayankunle, O. M., Ajani, G. O., Ghazali, S. M., Olumodeji, U. O., & Okere, R. A. (2021). Gestational Diabetes Mellitus: Assessing the Reliability of Risk Factor-Based Screening in a Rural Nigerian Hospital. Integrative Journal of Medical Sciences. https://doi.org/10.15342/ijms.2021.449

Prabakar, T. N., Shadaksharappa, B., & Ramkumar, P. (2022). Prediction of Diabetic Diseases Using Data Analysis. International journal of health sciences, 10013-10021. https://doi.org/10.53730/ijhs.v6ns1.7364

Rabizadeh, S., Rajab, A., Mechanick, J. I., Moosaie, F., Rahimi, Y., Nakhjavani, M., & Esteghamati, A. (2021). LDL/apo B Ratio Predict Coronary Heart Disease in Type 2 Diabetes Independent of ASCVD Risk Score: A Case-Cohort Study. Nutrition Metabolism and Cardiovascular Diseases, 31(5), 1477-1485. https://doi.org/10.1016/j.numecd.2021.01.013

Ramadevi, M., & Sunitha, S. (2025). Biomarkers for Early Detection of Kidney Injury Among Type 2 Diabetes Mellitus Patients. https://doi.org/10.21203/rs.3.rs-6975415/v1

Roobini, M. S., & Lakshmi, M. R. (2021). Predictive Supervised Learning Model for Classification of Type 2 Diabetes Mellitus. https://doi.org/10.21203/rs.3.rs-1009663/v1

Sabry, J. H., Ibrahim, M., Fadeel, S. A. E., & Elfallah, A. A. (2020). Study of FTO Gene Polymorphism Association With Type 2 Diabetes and Increasing BMI in Egyptian Patients. Benha Journal of Applied Sciences, 5(5), 1-9. https://doi.org/10.21608/bjas.2020.136647

Shiferaw, W. S., Akalu, T. Y., Petrucka, P., Areri, H. A., & Aynalem, Y. A. (2020). Risk Factors of Erectile Dysfunction Among Diabetes Patients in Africa: A Systematic Review and Meta-Analysis. Journal of Clinical & Translational Endocrinology, 21, 100232. https://doi.org/10.1016/j.jcte.2020.100232

Simaiya, S., Kaur, R., Sandhu, J. K., Alsafyani, M., Alroobaea, R., Alsekait, D. M., Margala, M., & Chakrabarti, P. (2022). A Novel Multistage Ensemble Approach for Prediction and Classification of Diabetes. Frontiers in Physiology, 13. https://doi.org/10.3389/fphys.2022.1085240

Suwito, B. E., Adji, A. S., Widjaja, J. S., Angel, S. C. S., Aufar Zimamuz Zaman Al, H., Salamy, N. F. W., & Choirotussanijjah, C. (2023). A Review of CRISPR Cas9 for SCA: Treatment Strategies and Could Target Β-Globin Gene and BCL11A Gene Using CRISPR Cas9 Prevent the Patient From Sickle Cell Anemia? Open Access Macedonian Journal of Medical Sciences, 11(F), 1-12. https://doi.org/10.3889/oamjms.2023.11435

Tang, X., Li, Q., Han, Y., Wang, X., Song, Y., Zhang, Z., Jingjing, X., Liu, Z., Chen, Y., Zhang, Y. Z., Zhu, P., Guo, X., Jiang, L., Wang, Z., Liu, R., Wang, Q., Yao, Y., Feng, Y., Zhao, X., & Yuan, J. (2024). Implications of Baseline Glycemic Control by Plasma Glycated Hemoglobin A1c on Adverse Outcomes in Patients With Coronary Heart Disease and Type 2 Diabetes Mellitus: Results From the PROMISE Study. Heliyon, 10(22), e39748. https://doi.org/10.1016/j.heliyon.2024.e39748

Woods, N. P., Tangpukdee, J., Thepa, T., & Methakanchanasak, N. (2023). Consequences of Sleep Deprivation in Adult Diabetes Mellitus Type 2 Patients: An Integrative Review. Open Access Macedonian Journal of Medical Sciences, 11(F), 1-10. https://doi.org/10.3889/oamjms.2023.10029

Wu, R., Guo, S., Lai, S., Pan, G., Zhang, L., & Liu, H. (2021). A Stable Gene Set for Prediction of Prognosis and Efficacy of Chemotherapy in Gastric Cancer. https://doi.org/10.21203/rs.3.rs-156785/v1

Younes, A., & Hamam, A. (2022). The Effect of Insulin and Metformin on Prevalence and Severity of Tooth Wear in Type2 Diabetic Patients. Egyptian Dental Journal, 68(3), 2659-2667. https://doi.org/10.21608/edj.2022.133026.2070

Zeinhom, M. G., Ahmed, S. R., Kohail, A., Kamel, I. F. M., Abdelrahman, A., Nozha, O. M. A., Almoataz, M. A., Youssif, T. Y. O., Daabis, A. M. A., Refat, H. M., Ahmed Ahmed Mohamed Kamal, E., Elbassiouny, A., Akl, A. Z. O., Shuaib, A., Ismaiel, M., & Khalil, M. F. E. (2024). A Multicenter Trial on the Predictors of Different Subtypes of Hemorrhagic Infarction After Thrombolysis. Scientific reports, 14(1). https://doi.org/10.1038/s41598-024-76189-0

Downloads

Published

2025-10-01

Submitted

2025-04-10

Revised

2025-09-05

Accepted

2025-09-12

How to Cite

Põder, K., & Martínez, A. L. (2025). Predicting Health-Related Quality of Life Among Patients With Type 2 Diabetes Using Random Forest and SHAP-Based Feature Importance Analysis. Quality of Life and Health Sciences, 1(2), 1-16. https://doi.org/10.61838/sxnr2h27