Implementation of Ridge Regression and SHAP for Analyzing Anxiety Levels Based on the Digital Behavior of Social Media Users

Authors

  • Kukuh Panggalih Universitas Bina Sarana Informatika
  • Yuri Yuliani Universitas Bina Sarana Informatika
  • Kudiantoro Widianto Universitas Bina Sarana Informatika
  • Erni Universitas Bina Sarana Informatika
  • M. Iqbal Alifudin Universitas Bina Sarana Informatika
  • Irwan Herliawan Universitas Nusa Mandiri

DOI:

https://doi.org/10.32664/smatika.v16i02.2370

Keywords:

Anxiety Digital Behavior, Anxiety Levels, Explainable Artificial Intelligent, Machine Learning, Ridge Regression, SHAP

Abstract

Advances in technology have led to an increase in the frequency of smartphone, social media, and various digital app usage in daily life. These digital activities give rise to various digital behaviors—such as screen time, number of notifications, social media usage, and sleep patterns—which can be evaluated to understand users mental health. High digital device usage is suspected to be associated with increased anxiety levels among users. Therefore, this study aims to analyze the impact of digital behaviors on anxiety levels by utilizing explainable machine learning approaches and AI. This study uses the dataset, comprising 500 data points obtained from Kaggle. The research stages consist EDA, feature engineering, target leakage evaluation, comparison of several machine learning algorithms, cross-validation, and model interpretation using SHAP. Based on the EDA results, the variables social_media_time_min, notification_count, and digital_addiction_score showed a positive relationship with anxiety_level. During the model-building process, the variable digital_wellbeing_score was removed because it had a very high correlation with anxiety_level -0.84, which could lead to potential target leakage. The algorithm comparison revealed that the Ridge Regression model performed best compared to Random Forest, SVR, and XGBoost Regression, with an R² score of 0.221 and an RMSE of 1.627. Additionally, the results of 5-Fold Cross Validation showed an average R² Score of 0.158 with a standard deviation of 0.062, indicating that the model demonstrated fairly consistent performance. The SHAP interpretation reveals that notification_count and social_media_time_min are the variables that most strongly influence the prediction of anxiety_level. The results of this study indicate that digital behavior affects users anxiety levels, although the relationships among the variables remain quite complex. This study also emphasizes the importance of evaluating the target leakage and understanding the model in the development of machine learning-based mental health analysis to ensure that the prediction results are more objective and clear.

References

[1] B. Keles, N. McCrae, and A. Grealish, “A systematic review: the influence of social media on depression, anxiety and psychological distress in adolescents,” Int. J. Adolesc. Youth, vol. 25, no. 1, pp. 79–93, 2020, doi: 10.1080/02673843.2019.1590851.

[2] A. M. Khalaf, A. A. Alubied, A. M. Khalaf, and A. A. Rifaey, “The Impact of Social Media on the Mental Health of Adolescents and Young Adults: A Systematic Review,” Cureus, vol. 15, no. 8, 2023, doi: 10.7759/cureus.42990.

[3] B. Kadirvelu, T. B. Bel, A. Freccero, M. Di Simplico, D. Nicholls, and A. A. Faisal, “Digital Phenotyping for Adolescent Mental Health: A Feasibility Study Employing Machine Learning to Predict Mental Health Risk From Active and Passive Smartphone Data (Preprint),” J. Med. Internet Res., 2025, doi: 10.2196/72501.

[4] P. Muzumdar, G. P. Basyal, and P. Vyas, “An Empirical Comparison of Machine Learning Models for Student’s Mental Health Illness Assessment,” Asian J. Comput. Inf. Syst., vol. 10, no. 1, pp. 1–10, 2022, doi: 10.24203/ajcis.v10i1.6882.

[5] K. A. W. W. Wardana and A. M. A. Rahim, "Analisis Perbandingan Algoritma XGBoost Dan Algoritma Random Forest Untuk Klasifikasi Data Kesehatan Mental," LOGIC: J. Ilmu Komput. dan Pendidik., vol. 2, no. 5, pp. 808–818, 2024.

[6] V. N. Dang and others, “Fairness and bias correction in machine learning for depression prediction across four study populations,” Sci. Rep., vol. 14, no. 1, pp. 1–12, 2024, doi: 10.1038/s41598-024-58427-7.

[7] E. Zulfa, H. Amir, R. Ginting, and Sudarno, “Analisis Korelasi Kesehatan Mental dan Indeks Prestasi Mahasiswa Jurusan Administrasi Niaga Politeknik Negeri Jakarta dengan Kombinasi Metode XGBoost dan SHAP,” vol. 5, pp. 26–37, 2024, doi: 10.32722/jap.v5i1.6923.

[8] E. Junianto and S. Nurkhodijah, “Explainable Ensemble Learning for Depression Risk Classification Using Multidomain Behavioral Features,” vol. 7, no. 2, pp. 778–792, 2026, doi: 10.52436/1.jutif.2026.7.2.5009.

[9] D. R. Wibowo, F. R. Umbara, and R. Ilyas, “Klasifikasi Kesehatan Mental Mahasiswa Menggunakan Light Gradient Boosting Machine Dan Analisa Fitur Menggunakan SHAP,” vol. 12, no. 4, pp. 636–647, 2025, doi: 10.30865/jurikom.v12i4.8871.

[10] R. D. Riley and others, “Calculating the sample size required for developing a clinical prediction model,” BMJ, vol. 368, pp. 1–12, 2020, doi: 10.1136/bmj.m441.

[11] J. Sedlakova and others, “Challenges and best practices for digital unstructured data enrichment in health research: A systematic narrative review,” PLOS Digit. Heal., vol. 2, no. 10, pp. 1–22, 2023, doi: 10.1371/journal.pdig.0000347.

[12] H. Shannon, K. Bush, P. J. Villeneuve, K. G. C. Hellemans, and S. Guimond, “Problematic Social Media Use in Adolescents and Young Adults: Systematic Review and Meta-analysis,” JMIR Ment. Heal., vol. 9, no. 4, 2022, doi: 10.2196/33450.

[13] M. Gupta and A. Sharma, “Fear of missing out: A brief overview of origin, theoretical underpinnings and relationship with mental health,” World J. Clin. Cases, vol. 9, no. 19, pp. 4881–4889, 2021, doi: 10.12998/wjcc.v9.i19.4881.

[14] F. C. Andrade and others, “Intervening on Social Comparisons on Social Media: Electronic Daily Diary Pilot Study,” JMIR Ment. Heal., vol. 10, 2023, doi: 10.2196/42024.

[15] A. Anto and others, “Exploring the Impact of Social Media on Anxiety Among University Students in the United Kingdom: Qualitative Study,” JMIR Form. Res., vol. 7, 2023, doi: 10.2196/43037.

[16] J. Tian, B. Li, and R. Zhang, “The Impact of Upward Social Comparison on Social Media on Appearance Anxiety: A Moderated Mediation Model,” Behav. Sci. (Basel)., vol. 15, no. 1, 2025, doi: 10.3390/bs15010008.

[17] J. D. Upshaw, C. E. Stevens, G. Ganis, and D. L. Zabelina, “The hidden cost of a smartphone: The effects of smartphone notifications on cognitive control from a behavioral and electrophysiological perspective,” PLoS One, vol. 17, no. 11, pp. 1–22, 2022, doi: 10.1371/journal.pone.0277220.

[18] C. A. Dekker, S. E. Baumgartner, S. R. Sumter, and J. Ohme, “Beyond the Buzz: Investigating the Effects of a Notification-Disabling Intervention on Smartphone Behavior and Digital Well-Being,” Media Psychol., vol. 28, no. 1, pp. 162–188, 2025, doi: 10.1080/15213269.2024.2334025.

[19] A. Yadav, M. Sankhla, K. Yadav, and I. Gupta, “Multiple linear regression approach to deduce Internet addiction impact on the psychosocial wellness of young medical students,” Natl. J. Physiol. Pharm. Pharmacol., vol. 12, p. 1, 2021, doi: 10.5455/njppp.2022.12.08280202116082021.

[20] A. V Ponce-Bobadilla, V. Schmitt, C. S. Maier, S. Mensing, and S. Stodtmann, “Practical guide to SHAP analysis: Explaining supervised machine learning model predictions in drug development,” Clin. Transl. Sci., vol. 17, no. 11, pp. 1–15, 2024, doi: 10.1111/cts.70056.

[21] T. Mokheleli, T. Bokaba, and E. Mbunge, “Explainable Artificial Intelligence for Workplace Mental Health Prediction,” Informatics, vol. 12, no. 4, 2025, doi: 10.3390/informatics12040130.

Downloads

Published

2026-06-28