Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
Multicenter Study
. 2025 May 8:34:e28.
doi: 10.1017/S2045796025000198.

Identifying most important predictors for suicidal thoughts and behaviours among healthcare workers active during the Spain COVID-19 pandemic: a machine-learning approach

Affiliations
Multicenter Study

Identifying most important predictors for suicidal thoughts and behaviours among healthcare workers active during the Spain COVID-19 pandemic: a machine-learning approach

Itxaso Alayo et al. Epidemiol Psychiatr Sci. .

Abstract

Aims: Studies conducted during the COVID-19 pandemic found high occurrence of suicidal thoughts and behaviours (STBs) among healthcare workers (HCWs). The current study aimed to (1) develop a machine learning-based prediction model for future STBs using data from a large prospective cohort of Spanish HCWs and (2) identify the most important variables in terms of contribution to the model's predictive accuracy.

Methods: This is a prospective, multicentre cohort study of Spanish HCWs active during the COVID-19 pandemic. A total of 8,996 HCWs participated in the web-based baseline survey (May-July 2020) and 4,809 in the 4-month follow-up survey. A total of 219 predictor variables were derived from the baseline survey. The outcome variable was any STB at the 4-month follow-up. Variable selection was done using an L1 regularized linear Support Vector Classifier (SVC). A random forest model with 5-fold cross-validation was developed, in which the Synthetic Minority Oversampling Technique (SMOTE) and undersampling of the majority class balancing techniques were tested. The model was evaluated by the area under the Receiver Operating Characteristic (AUROC) curve and the area under the precision-recall curve. Shapley's additive explanatory values (SHAP values) were used to evaluate the overall contribution of each variable to the prediction of future STBs. Results were obtained separately by gender.

Results: The prevalence of STBs in HCWs at the 4-month follow-up was 7.9% (women = 7.8%, men = 8.2%). Thirty-four variables were selected by the L1 regularized linear SVC. The best results were obtained without data balancing techniques: AUROC = 0.87 (0.86 for women and 0.87 for men) and area under the precision-recall curve = 0.50 (0.55 for women and 0.45 for men). Based on SHAP values, the most important baseline predictors for any STB at the 4-month follow-up were the presence of passive suicidal ideation, the number of days in the past 30 days with passive or active suicidal ideation, the number of days in the past 30 days with binge eating episodes, the number of panic attacks (women only) and the frequency of intrusive thoughts (men only).

Conclusions: Machine learning-based prediction models for STBs in HCWs during the COVID-19 pandemic trained on web-based survey data present high discrimination and classification capacity. Future clinical implementations of this model could enable the early detection of HCWs at the highest risk for developing adverse mental health outcomes.

Study registration: NCT04556565.

Keywords: attempted suicide; interpretability; machine learning; mental health; suicidal ideation.

PubMed Disclaimer

Conflict of interest statement

E.A. reports personal fees from Lundbeck, Esteve and Boehringer-Ingelheim, outside the submitted work. E.V. has received grants and served as a consultant, advisor or Continuing Medical Education (CME) speaker for the following entities: AB-Biotics, AbbVie, Adamed, Alcediag, Angelini, Biogen, Beckley-Psytech, Biohaven, Boehringer-Ingelheim, Celon Pharma, Compass, Dainippon Sumitomo Pharma, Ethypharm, Ferrer, Gedeon Richter, GH Research, Glaxo-Smith Kline, HMNC, Idorsia, Johnson & Johnson, Lundbeck, Luye Pharma, Medincell, Merck, Newron, Novartis, Orion Corporation, Organon, Otsuka, Roche, Rovi, Sage, Sanofi-Aventis, Sunovion, Takeda, Teva and Viatris, outside the submitted work. A.G.-P. has received grants and served as a consultant, advisor or CME speaker for the following entities: Janssen-Cilag, Lundbeck, Otsuka, Alter, Angelini, Novartis, Rovi, Takeda, the Spanish Ministry of Science and Innovation (CIBERSAM), the Ministry of Science (Carlos III Institute), the Basque Government and the European Framework Program of Research. J.M.H. has served as a consultant, advisor or CME speaker for the following entities: Boehringer-Ingelheim, Eli Lilly and Co. and Lundbeck, outside the submitted work. J.M.P.-T. has served as a consultant, advisor or CME speaker for the following entities: Angelini, Boehringer-Ingelheim, Eli Lilly and Co, Johnson & Johnson Lundbeck, Otsuka and Rovi, outside the submitted work. All other authors reported no conflict of interest. R.B. reports fees from Janssen-Cilag, outside the submitted work.

Figures

Figure 1.
Figure 1.
(a) The receiver operating characteristics curve and the area under the receiver operating characteristic curve (AUROC) for suicidal thoughts and behavior prediction. The results of the prediction using different balancing test are shown (left). (b) The precision-recall curve and the area underthe precision-recall curve of the models. The results of the prediction using different balancing test are shown (right).
Figure 2.
Figure 2.
(a) The receiver operating characteristics curve and the area under the receiver operating characteristic (AUROC) curve of the models for men and women. (b) The precision-recall curve and the area under the precision-recall curve of the models for men and women.
Figure 3.
Figure 3.
Shapley additive explanation (SHAP) summary graph. Each point on the graph is a SHAP value for one variable. The color represents the value of the variable from low (blue) to high (pink).
Figure 4.
Figure 4.
Shapley additive explanation (SHAP) summary graph. for men (a) and women (b).

References

    1. Alonso J, Vilagut G, Alayo I, Ferrer M, Amigo F, Aragón-Peña A, Aragonès E, Campos M, Del Cura-gonzález I, Urreta I, Espuga M, González Pinto A, Haro JM, López Fresneña N, Martínez de Salázar A, Molina JD, Ortí Lucas RM, Parellada M, Pelayo-Terán JM, Pérez Zapata A, Pijoan JI, Plana N, Puig MT, Rius C, Rodriguez-Blazquez C, Sanz F, Serra C, Kessler RC, Bruffaerts R, Vieta E, Pérez-Solá V and Mortier P (2022) Mental impact of Covid-19 among Spanish healthcare workers. A large longitudinal survey. Epidemiology and Psychiatric Sciences 31, e28. doi:10.1017/S2045796022000130 - DOI - PMC - PubMed
    1. Alonso J, Vilagut G, Mortier P, Ferrer M, Alayo I, Aragón-Peña A, Aragonès E, Campos M, Cura-González ID, Emparanza JI, Espuga M, Forjaz MJ, González-Pinto A, Haro JM, López-Fresneña N, Salázar ADMD, Molina JD, Ortí-Lucas RM, Parellada M, Pelayo-Terán JM, Pérez-Zapata A, Pijoan JI, Plana N, Puig MT, Rius C, Rodríguez-Blázquez C, Sanz F, Serra C, Kessler RC, Bruffaerts R, Vieta E and Pérez-Solà V (2021) Mental health impact of the first wave of COVID-19 pandemic on Spanish healthcare workers: a large cross-sectional survey. Revista de Psiquiatria y Salud Mental. 14, 90–105. doi:10.1016/j.rpsm.2020.12.001 - DOI - PMC - PubMed
    1. Alshammari HF and Dayrit RDJ (2017) Conflict and conflict resolution among the medical and nursing personnel of selected hospitals in Hail City. IOSR Journal of Nursing and Health Science 06, 45–60. doi:10.9790/1959-0603014560 - DOI
    1. Ati NAL, Paraswati MD and Windarwati HD (2021) What are the risk factors and protective factors of suicidal behavior in adolescents? A systematic review. Journal of Child and Adolescent Psychiatric Nursing 34, 7–18. doi:10.1111/jcap.12295 - DOI - PubMed
    1. Auret L and Aldrich C (2012) Interpretation of nonlinear relationships between process variables by use of random forests. Minerals Engineering 35, 27–42. doi:10.1016/j.mineng.2012.05.008 - DOI

Publication types

Associated data