Skip to main content

Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

  • Article
  • Published:

Prediction of self-harm in people with newly-diagnosed depression: development and validation of risk prediction models

Abstract

Depression is associated with increased self-harm risk, particularly in the early illness course, yet individualised predictions models remain underexplored. We aimed to develop and externally validate a prediction model for self-harm risk in people with newly-diagnosed-depression. Utilizing a territory-wide electronic health-record (EHR) database spanning Hong-Kong public healthcare services (including all public hospitals, specialists, and general outpatient clinics), we identified individuals aged ≥12 years with first-diagnosed depression between 1-January-2002 and 31-December-2021. The primary outcome was non-fatal self-harm and/or completed suicide. We developed 1-year and 3-year self-harm risk prediction models using the least absolute shrinkage and selection operator (LASSO) method and backward regression model. This population-based cohort comprised 102,863 individuals with newly-diagnosed-depression (mean age 48.22 [SD 17.78] years; 71.5% female), 2678 self-harm incidents occurred over 98,807.5 person-years (rate: 27.09 [95%CI 26.1-28.1] per 1000 person-years). Key predictors included history of self-poisoning/self-inflicted injury, past psychiatric hospitalisation, comorbid somatoform and conversion disorders, and substance use disorders, while use of lithium and antidepressants represented protective factors. In external validation cohort (n = 14,843), our model achieved good discrimination (C-statistics = 0.83 [95%CI 0.80-0.85], D = 2.35 [2.17-2.53]), near-perfect calibration (calibration slope =1.00 [0.94-1.06], O/E ratio = 1.00 [0.90-1.10]), and high accuracy (brier score = 0.02 [0.02-0.02]). Performance remained robust in age, sex-stratified subgroups and 1-year vs. 3-year self-harm prediction windows. This validated model leverages EHR data to accurately identified individuals at elevated self-harm risk post-depression diagnosis, may tailor individual-level risk estimates and facilitate timely interventions, thereby potentially averting risk escalation, in the critical window of heightened self-harm risk.

This is a preview of subscription content, access via your institution

Access options

Buy this article

USD 39.95

Prices may be subject to local taxes which are calculated during checkout

Fig. 1
Fig. 2: Calibration plot and performance metrices of LASSO model for 1-year self-harm risk in sex and age stratified subgroups in the external validation dataset.

Similar content being viewed by others

Data availability

Data collected for this study are proprietary of the Hospital Authority of Hong Kong, which granted researchers permission and access to data. The data that support the findings of this study are available from this authority, but restrictions apply to the availability to these data (information on the cost is available from the corresponding author). The analytic codes are available from the corresponding author on request.

References

  1. GBD Mental Disorders Collaborators. Global, regional, and national burden of 12 mental disorders in 204 countries and territories, 1990–2019: a systematic analysis for the Global Burden of Disease Study 2019. Lancet Psychiatry. 2022;9:137–50.

    Article  Google Scholar 

  2. Lo HKY, Chan JKN, Wong CSM, Chung KF, Correll CU, Solmi M, et al. Excess mortality and life-years lost in people diagnosed with depression: A 20-year population-based cohort study of 126,573 depressed individuals followed for 1,139,073 persons-years. Eur Neuropsychopharmacol. 2025;91:1–8.

    Article  CAS  PubMed  Google Scholar 

  3. Chesney E, Goodwin GM, Fazel S. Risks of all-cause and suicide mortality in mental disorders: a meta-review. World Psychiatry. 2014;13:153–60.

    Article  PubMed  PubMed Central  Google Scholar 

  4. National Institute for Health and Care Excellence (NICE). Self-harm. 2019.

  5. Liu B-P, Jia C-X, Qin P, Zhang Y-Y, Yu Y-K, Luo X, et al. Associating factors of suicide and repetition following self-harm: A systematic review and meta-analysis of longitudinal studies. eClinicalMedicine. 2022;49:101461.

    Article  PubMed  PubMed Central  Google Scholar 

  6. Lundberg J, Cars T, Lampa E, Ekholm Selling K, Leval A, Gannedahl A, et al. Determinants and outcomes of suicidal behavior among patients with major depressive disorder. JAMA Psychiatry. 2023;80:1218–25.

    Article  PubMed  PubMed Central  Google Scholar 

  7. Chai Y, Luo H, Yip PSF. Prevalence and risk factors for repetition of non-fatal self-harm in Hong Kong, 2002–2016: a population-based cohort study. Lancet Reg Health - West Pac. 2020;2:100027.

    PubMed  PubMed Central  Google Scholar 

  8. Pigoni A, Delvecchio G, Turtulici N, Madonna D, Pietrini P, Cecchetti L, et al. Machine learning and the prediction of suicide in psychiatric populations: a systematic review. Transl Psychiatry. 2024;14:140.

    Article  PubMed  PubMed Central  Google Scholar 

  9. Spittal MJ, Pirkis J, Miller M, Carter G, Studdert DM. The repeated episodes of self-harm (RESH) score: a tool for predicting risk of future episodes of self-harm by hospital patients. J Affect Disord. 2014;161:36–42.

    Article  PubMed  Google Scholar 

  10. Franklin JC, Ribeiro JD, Fox KR, Bentley KH, Kleiman EM, Huang X, et al. Risk factors for suicidal thoughts and behaviors: A meta-analysis of 50 years of research. Psychol Bull. 2017;143:187–232.

    Article  PubMed  Google Scholar 

  11. Jiang T, Nagy D, Rosellini AJ, Horváth-Puhó E, Keyes KM, Lash TL, et al. Prediction of suicide attempts among persons with depression: a population-based case cohort study. Am J Epidemiol. 2024;193:827–34.

    Article  PubMed  PubMed Central  Google Scholar 

  12. Jiang T, Rosellini AJ, Horváth-Puhó E, Shiner B, Street AE, Lash TL, et al. Using machine learning to predict suicide in the 30 days after discharge from psychiatric hospital in Denmark. Br J Psychiatry. 2021;219:440–7.

    Article  PubMed  PubMed Central  Google Scholar 

  13. Ge F, Jiang J, Wang Y, Yuan C, Zhang W. Identifying suicidal ideation among Chinese patients with major depressive disorder: evidence from a real-world hospital-based study in China. Neuropsychiatr Dis Treat. 2020;16:665–72.

    Article  PubMed  PubMed Central  Google Scholar 

  14. Li X-Y, Tabarak S, Su X-R, Qin Z, Chai Y, Zhang S, et al. Identifying clinical risk factors correlate with suicide attempts in patients with first episode major depressive disorder. J Affect Disord. 2021;295:264–70.

    Article  PubMed  Google Scholar 

  15. Nickson D, Meyer C, Walasek L, Toro C. Prediction and diagnosis of depression using machine learning with electronic health records data: a systematic review. BMC Med Inform Decis Mak. 2023;23:271.

    Article  PubMed  PubMed Central  Google Scholar 

  16. Barak-Corren Y, Castro VM, Nock MK, Mandl KD, Madsen EM, Seiger A, et al. Validation of an electronic health record–based suicide risk prediction modeling approach across multiple health care systems. JAMA Netw Open. 2020;3:e201262.

    Article  PubMed  PubMed Central  Google Scholar 

  17. Chai Y, Luo H, Wong GHY, Tang JYM, Lam T-C, Wong ICK, et al. Risk of self-harm after the diagnosis of psychiatric disorders in Hong Kong, 2000–10: a nested case-control study. Lancet Psychiatry. 2020;7:135–47.

    Article  PubMed  Google Scholar 

  18. Haagsma JA, Graetz N, Bolliger I, Naghavi M, Higashi H, Mullany EC, et al. The global burden of injury: incidence, mortality, disability-adjusted life years and time trends from the Global Burden of Disease study 2013. Inj Prev. 2016;22:3–18.

    Article  PubMed  Google Scholar 

  19. Ilgen MA, Downing K, Zivin K, Hoggatt KJ, Kim HM, Ganoczy D, et al. Exploratory data mining analysis identifying subgroups of patients with depression who are at high risk for suicide. J Clin Psychiatry. 2009;70:6977.

    Article  Google Scholar 

  20. Hospital Authority Head Office IT and Department. Clinical Data Analysis & Reporting System (CDARS) User’s Manual, 2nd Edition. 2003

  21. Census and Statistics Department of the HKSAR Government. Population Estimates. 2023 [cited 2024 Dec 3]. Available from: https://www.censtatd.gov.hk/hkstat/sub/sp150.jsp?tableID=001&ID=0&productType=8.

  22. Hong Kong Hospital Authority. Hong Kong Hospital Authority. Visitor information. [cited 2025 July 6]. Available from: https://www.ha.org.hk/visitor/ha_visitor_index.asp?Content_ID=10008&Lang=ENG&Dimension=100.

  23. Cheung N, Fung V, Wong W. Principles—based medical informatics for success—how Hong Kong built one of the world’s largest integrated longitudinal electronic patients records. Stud Health Technol Inform. 2007;129:307–10.

    PubMed  Google Scholar 

  24. Chan JKN, Wong CSM, Yung NCL, Chen EYH, Chang WC. Excess mortality and life-years lost in people with bipolar disorder: an 11-year population-based cohort study. Epidemiol Psychiatr Sci. 2021;30:e39.

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  25. Chang WC, Chan JKN, Wong CSM, Hai JSH, Or PCF, Chen EYH. Mortality, revascularization, and cardioprotective pharmacotherapy after acute coronary syndrome in patients with psychotic disorders: a population-based cohort study. Schizophr Bull. 2020;46:774–84.

    Article  PubMed  PubMed Central  Google Scholar 

  26. Yung NCL, Wong CSM, Chan JKN, Or PCF, Chen EYH, Chang WC. Mortality in patients with schizophrenia admitted for incident ischemic stroke: A population-based cohort study. Eur Neuropsychopharmacol. 2020;31:152–7.

    Article  CAS  PubMed  Google Scholar 

  27. Chai Y, Luo H, Yip PSF. Prevalence and risk factors for repetition of non-fatal self-harm in Hong Kong, 2002-16: A population-based cohort study. Lancet Reg Health - West Pac. 2020;2:100027.

    PubMed  PubMed Central  Google Scholar 

  28. Harrell FE. General aspects of fitting regression models. In: Harrell FE, editor. Regression modeling strategies: with applications to linear models, logistic regression, and survival analysis. New York, NY: Springer; 2001; pp 11–40.

  29. Singhal A, Ross J, Seminog O, Hawton K, Goldacre MJ. Risk of self-harm and suicide in people with specific psychiatric and physical disorders: comparisons between disorders using English national record linkage. J R Soc Med. 2014;107:194–204.

    Article  PubMed  PubMed Central  Google Scholar 

  30. Chan MKY, Bhatti H, Meader N, Stockton S, Evans J, O’Connor RC, et al. Predicting suicide following self-harm: systematic review of risk factors and risk scales. Br J Psychiatry. 2016;209:277–83.

    Article  PubMed  Google Scholar 

  31. Melhem NM, Porta G, Oquendo MA, Zelazny J, Keilp JG, Iyengar S, et al. Severity and variability of depression symptoms predicting suicide attempt in high-risk individuals. JAMA Psychiatry. 2019;76:603–13.

    Article  PubMed  PubMed Central  Google Scholar 

  32. Hsu J-W, Lin W-C, Tsai S-J, Cheng C-M, Chang W-H, Bai Y-M, et al. Somatic symptom disorder, psychiatric comorbidities, and suicide. J Affect Disord. 2025;373:459–64.

    Article  PubMed  Google Scholar 

  33. Torres ME, Löwe B, Schmitz S, Pienta JN, Van Der Feltz-Cornelis C, Fiedorowicz JG. Suicide and suicidality in somatic symptom and related disorders: A systematic review. J Psychosom Res. 2021;140:110290.

    Article  PubMed  Google Scholar 

  34. Mars B, Heron J, Klonsky ED, Moran P, O’Connor RC, Tilling K, et al. Predictors of future suicide attempt among adolescents with suicidal thoughts or non-suicidal self-harm: a population-based birth cohort study. Lancet Psychiatry. 2019;6:327–37.

    Article  PubMed  PubMed Central  Google Scholar 

  35. Moran P, Coffey C, Romaniuk H, Olsson C, Borschmann R, Carlin JB, et al. The natural history of self-harm from adolescence to young adulthood: a population-based cohort study. The Lancet. 2012;379:236–43.

    Article  Google Scholar 

  36. Novick D, Montgomery W, Aguado J, Kadziola Z, Peng X, Brugnoli R, et al. Which somatic symptoms are associated with an unfavorable course in Asian patients with major depressive disorder? J Affect Disord. 2013;149:182–8.

    Article  PubMed  Google Scholar 

  37. Courtet P, Lopez-Castroman J. Antidepressants and suicide risk in depression. World Psychiatry. 2017;16:317–8.

    Article  PubMed  PubMed Central  Google Scholar 

  38. Didham RC, McConnell DW, Blair HJ, Reith DM. Suicide and self-harm following prescription of SSRIs and other antidepressants: confounding by indication. Br J Clin Pharmacol. 2005;60:519–25.

    Article  PubMed  PubMed Central  Google Scholar 

  39. Cipriani A, Hawton K, Stockton S, Geddes JR. Lithium in the prevention of suicide in mood disorders: updated systematic review and meta-analysis. BMJ Online. 2013;346:13.

    Google Scholar 

  40. Su C, Aseltine R, Doshi R, Chen K, Rogers SC, Wang F. Machine learning for suicide risk prediction in children and adolescents with electronic health records. Transl Psychiatry. 2020;10:413.

    Article  PubMed  PubMed Central  Google Scholar 

  41. Jensen PB, Jensen LJ, Brunak S. Mining electronic health records: towards better research applications and clinical care. Nat Rev Genet. 2012;13:395–405.

    Article  CAS  PubMed  Google Scholar 

  42. Sendak MP, Ratliff W, Sarro D, Alderton E, Futoma J, Gao M, et al. Real-world integration of a sepsis deep learning technology into routine clinical care: implementation study. JMIR Med Inform. 2020;8:e15182.

    Article  PubMed  PubMed Central  Google Scholar 

  43. Wiens J, Saria S, Sendak M, Ghassemi M, Liu VX, Doshi-Velez F, et al. Do no harm: a roadmap for responsible machine learning for health care. Nat Med. 2019;25:1337–40.

    Article  CAS  PubMed  Google Scholar 

  44. Beam AL, Kohane IS. Big data and machine learning in health care. JAMA. 2018;319:1317–8.

    Article  PubMed  Google Scholar 

  45. Price WN, Cohen IG. Privacy in the age of medical big data. Nat Med. 2019;25:37–43.

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  46. Delgadillo J, Lutz W. A development pathway towards precision mental health care. JAMA Psychiatry. 2020;77:889–90.

    Article  PubMed  Google Scholar 

  47. Rapport F, Clay-Williams R, Churruca K, Shih P, Hogden A, Braithwaite J. The struggle of translating science into action: foundational concepts of implementation science. J Eval Clin Pract. 2018;24:117–26.

    Article  PubMed  Google Scholar 

  48. Belsher BE, Smolenski DJ, Pruitt LD, Bush NE, Beech EH, Workman DE, et al. Prediction models for suicide attempts and deaths: a systematic review and simulation. JAMA Psychiatry. 2019;76:642–51.

    Article  PubMed  Google Scholar 

  49. Schwartz B, Cohen ZD, Rubel JA, Zimmermann D, Wittmann WW, Lutz W. Personalized treatment selection in routine care: integrating machine learning and statistical algorithms to recommend cognitive behavioral or psychodynamic therapy. Psychother Res. 2021;31:33–51.

    Article  PubMed  Google Scholar 

  50. Gao L, Man KKC, Chan EW, Chui CSL, Li X, Coghill D, et al. Treatment with methylphenidate for attention deficit hyperactivity disorder (ADHD) and the risk of all-cause poisoning in children and adolescents: a self-controlled case series study. CNS Drugs. 2021;35:769–79.

    Article  CAS  PubMed  PubMed Central  Google Scholar 

Download references

Acknowledgements

The authors would like to thank the colleagues in the Hospital Authority of Hong Kong for their kind assistance in data extraction for the current investigation.

Funding

The study was supported by the Health and Medical Research Fund, Food and Health Bureau of the HKSAR government (reference number: 21222111). The funders of the study had no role in study design, data collection and analysis, decision to publish or preparation of the manuscript.

Author information

Authors and Affiliations

Authors

Contributions

WCC, JKNC and CSMW conceptualized and designed the study. WCC contributed to the acquisition of data. WCC and JKNC oversaw the data analysis and interpreted the results. IWLC contributed to the data analysis and interpretation of the results. HKYL interpreted the data and wrote the first draft of manuscript and revised the manuscript. WCC and JKNC contributed substantially to the revision of manuscript drafts. WCC and HKYL finalized the manuscript. All authors provided critical feedback to the manuscript drafts, reviewed and approved the final manuscript.

Corresponding author

Correspondence to Wing Chung Chang.

Ethics declarations

Statement of ethics

The study was approved by the Institutional Review Board of the University of Hong Kong/Hospital Authority HK-West Cluster (UW 23-540). Since study data were anonymized and individual patient records were completely unidentifiable during the analysis, and the study was based on retrieved public health-record database, the requirement for written informed consent was waived by the Institutional Review Board. The study was conducted in accordance with the World Medical Association Declaration of Helsinki.

Competing interests

The authors declare no competing interests.

Additional information

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary information

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Lo, H.K.Y., Chu, I.W.L., Chan, J.K.N. et al. Prediction of self-harm in people with newly-diagnosed depression: development and validation of risk prediction models. Mol Psychiatry (2026). https://doi.org/10.1038/s41380-026-03555-x

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Version of record:

  • DOI: https://doi.org/10.1038/s41380-026-03555-x

Search

Quick links