Abstract
Background:
Accurate identification of persons at risk of suicide is challenging because suicide is a rare outcome with a multifactorial origin. The purpose of this study was to predict suicide among persons with depression using machine learning methods.
Methods:
A case-cohort study was conducted in Denmark between January 1, 1995 and December 31, 2015. Cases were all persons who died by suicide and had an incident depression diagnosis in Denmark (n = 2,774). The comparison subcohort was a 5% random sample of all individuals in Denmark at baseline, restricted to persons with an incident depression diagnosis during the study period (n = 11,963). Classification trees and random forests were used to predict suicide.
Results:
In men with depression, there was a high risk of suicide among those who were prescribed other analgesics and antipyretics (i.e., non-opioid analgesics such as acetaminophen), prescribed hypnotics and sedatives, and diagnosed with a poisoning (n = 96; risk = 81%). In women with depression, there was an elevated risk of suicide among those who were prescribed other analgesics and antipyretics, anxiolytics, hypnotics and sedatives but were not diagnosed with poisoning nor cerebrovascular diseases (n = 338; risk = 58%).
Discussion:
Psychiatric disorders and their associated medications were strongly indicative of suicide risk. Notably, anti-inflammatory medications (e.g., acetaminophen) prescriptions, which are used to treat chronic pain and illnesses, were associated with suicide risk in persons with depression. Machine learning may advance our ability to predict suicide deaths.
Keywords: suicide, depression, prediction, machine learning, registry, Denmark
INTRODUCTION
Suicide is a leading cause of death globally, accounting for approximately 800,000 deaths annually (World Health Organization, 2019). Depression has a well-established, strong association with suicide (Bostwick & Pankratz, 2000; Ribeiro et al., 2018; Van Orden et al., 2010); the suicide rate among persons with depression is nearly 20 times the suicide rate in the general population (Ferrari et al., 2013). A potential explanation for this robust link is that persons living with depression may view their situation as untenable or hopeless to the extent that suicide is the only possible solution (Minkoff et al., 1973).
Given its strong association with suicide, depression is commonly used in risk factor guidelines to assess the risk of suicide (Conwell et al., 1996; Harwood et al., 2001; Henriksson et al., 1993; LeFevre & U.S. Preventive Services Task Force, 2014; Ribeiro et al., 2018). However, relying solely on depression status to detect suicide risk is unlikely to be successful because the majority of persons with depression do not die by suicide and suicide is a rare outcome rooted in a constellation of causes (Goldstein et al., 1991; Ribeiro et al., 2018). Accurate suicide prediction likely requires consideration of numerous risk factors and their interactions (Franklin et al., 2017). For example, persons with depression often have comorbid mental disorders (e.g., anxiety, substance use disorder, borderline personality disorder) and are frequently prescribed various medications (e.g., antidepressants, hypnotics and sedatives, anti-anxiety drugs) (Hasin et al., 2018; Olfson & Klerman, 1992; Valenstein et al., 2004). It is critical to understand how psychiatric disorders and medications, alongside other medical and social risk factors, may jointly influence suicide risk given the recent rise in overdose deaths involving prescription medications, some of which may include suicides (Oquendo & Volkow, 2018). Moreover, depression and suicide may be linked through inflammatory pathways that are associated changes in emotion and behavior (Bergmans et al., 2019; Brundin et al., 2015, 2017; Keaton et al., 2019), further documenting the need to examine prescription medications that may modulate inflammation. Knowledge of the complex interactions between numerous risk factors that are associated with suicide may inform risk detection strategies (e.g., for whom to conduct face-to-face suicide risk assessments) and identification of modifiable risk factors for suicide prevention.
The application of machine learning to analyzing large-scale administrative health registry data may help improve suicide prediction because these methods can detect complex patterns and interactions amid thousands of variables (Gradus et al., 2020; Kessler et al., 2017; Kessler et al., 2015). Gradus et al. predicted sex-specific suicide risk using machine learning in the general population of Denmark and found that major depressive disorder and antidepressants were important risk factors for suicide (Gradus et al., 2020). An important next step is to develop prediction models in high risk diagnostic populations, such as persons with depression, to improve prediction accuracy and relevance for clinicians treating patients with depression (Fazel & O’Reilly, 2019). Risk factors for suicide may differ in persons with depression compared with the general population in ways that are informative for prevention and intervention.
Given the considerable challenge currently faced by clinicians in identifying persons at high risk of suicide among persons with depression, leveraging routinely-collected health data may advance our ability to identify modifiable clinical targets for intervention. Accurate identification of depressed persons at risk of suicide is also essential for clinicians to deliver interventions (e.g., safety planning, cognitive behavioral therapy, pharmacotherapy) to those in greatest need (Doupnik et al., 2020; Isometsä et al., 1994). The purpose of this study was to develop sex-specific risk profiles for suicide among persons with depression using population-based, prospective Danish medical and social registry data and machine learning methods. The machine learning models were stratified by sex at birth, in accordance with well-established sex differences in the incidence of suicide and suicide risk factors (Miranda-Mendizabal et al., 2019; Möller-Leimkühler, 2003). Sex-stratified examination may elucidate distinct risk profiles for suicide in men and women given that the global suicide rate for men is over twice that of women (World Health Organization, 2021).
METHODS
Study Sample
We used data from medical and social registries in Denmark where all persons are covered by a universal healthcare system (Schmidt et al., 2015). We conducted a case-cohort study because it is an efficient design for studying rare outcomes such as suicide (Prentice, 1986). In our case-cohort study, we identified all cases of suicide death who had an incident depression diagnosis in Denmark between January 1, 1995 and December 31, 2015 (n = 2,774). We obtained suicide cases from the Danish Cause of Death Registry using the International Statistical Classification of Diseases and Related Health Problems, Tenth Revision (ICD-10) codes X60–X84 (Helweg-Larsen, 2011). In a validation study, 92% of the deaths recorded as suicides were confirmed by experts as suicide deaths (8% of suicide deaths were reclassified as undetermined manner of death) (Tøllefsen et al., 2015). The comparison subcohort was a 5% random sample of all individuals born or residing in Denmark on January 1, 1995, restricted to persons with an incident depression diagnosis between January 1, 1995 and December 31, 2015 (n = 11,963). We obtained inpatient and outpatient depression diagnoses from the Danish Psychiatric Central Research Register and the Danish National Patient Registry using ICD-10 codes F32–F39. We did not match on any factors to allow for maximum variability in the predictors for the machine learning analyses.
Predictors
We examined the following variables as predictors in the machine learning models: age, marital status, immigrant status/citizenship, family suicide death history (parent or spouse), prior suicide attempt, employment, income, inpatient and outpatient mental disorders and somatic disorders, surgeries, and prescription drugs. We used the Danish Civil Registration System to obtain data on age, marital status, immigrant status, generation of citizenship, and family suicide death history (Pedersen, 2011). We used the Integrated Database for Labor Market Research and Income Statistics Register to ascertain baseline data on employment and income (Baadsgaard & Quitzau, 2011; Timmermans, 2010). We obtained psychiatric disorder diagnoses using two-digit ICD-10 codes from the Danish Psychiatric Central Research Register and Danish National Patient Registry (Mors et al., 2011; Schmidt et al., 2015). We also used the Danish National Patient Registry to obtain inpatient and outpatient somatic diagnoses as recorded by second-level ICD-10 groupings. Surgery procedure codes from the Danish National Patient Registry were examined according to body system. We obtained data on prescription drugs from the Danish National Prescription Registry (Kildemoes et al., 2011; Pottegård et al., 2017). Prescription drugs for this study were coded according to level three Anatomical Therapeutic Classification codes. The appendix contains all codes analyzed in this study.
In general, we used data for all demographic variables from one time point and treated all diagnostic and treatment variables as time-varying. For suicide cases, we dummy-coded variables to create time-varying predictors with intervals of 0–6, 0–12, 0–24, and 0–48 months before the date of death. For comparison subcohort members, we randomly selected a date between their depression diagnosis date and the end of follow-up and then calculated the prevalence of each predictor 0–6, 0–12, 0–24, and 0–48 months before the selected date to estimate the prevalence of predictors in the person-time that gave rise to cases (Rothman et al., 2008). Age and immigrant status were defined at baseline. Employment and income were defined in the year before the date of death for suicide cases and in the year before the selected date between depression diagnosis and end of follow-up for comparison subcohort members.
Statistical Analysis
We performed data reduction to reduce the risk of overfitting, which occurs when a model performs well on the data for which it was developed but performs poorly on a new dataset not used in model development (James et al., 2013). We removed rare predictors that had 10 or fewer observations in any cell of a 2×2 table of the predictor and suicide for men and women separately (Adams et al., 2021; Jiang, Rosellini, et al., 2021). The initial analytic dataset contained 2547 predictors. After removing rare predictors, the number of included predictors was 780 for men and 803 for women (Appendix Table 1).
We then used classification trees to visually evaluate the data structure and identify interactions between variables that were associated with suicide. To reduce the risk of model overfit and improve interpretability, we set the maximum tree depth to five and the minimum number of observations in any node to 10. We used equal priors to address class imbalance (Kuhn & Johnson, 2013), which refers to an unequal distribution of classes, since suicide is a rare event and there are more non-cases than cases of suicide (Kuhn & Johnson, 2013). The risk of suicide was calculated for each combination of predictors (“branch”) in the classification tree. We used the R package rpart, which performs a 10-fold cross validation procedure (Therneau et al., 2019).
Random forests is a recursive partitioning method that is comprised of a set of decision trees generated using bootstrapped samples of the data. Each forest was built with 1000 trees and a minimum of 10 observations were required to make a split. The number of variables sampled as split candidates at each node were 28 for both men and women (i.e., the square root of the total number of predictors for men and women). Each individual tree in the random forest used equal proportions of suicide observations and non-suicide observations to mitigate class imbalance using the “sample.fraction” tuning parameter of the R package ranger (Wright & Ziegler, 2017). We calculated the mean decrease in accuracy (MDA) of each variable, which represents the reduction in accuracy if a predictor were permuted (Strobl et al., 2009). The larger the MDA is when a predictor is permuted, the more important that variable is for accurate suicide prediction. We evaluated the area under the receiver operating characteristic curve (AUC) using 10-fold cross validation using the R package caret and estimated the 95% confidence interval (CI) for the cross-validated AUC using bootstrapping in 1000 replicates (Kuhn, 2008; Robin et al., 2011). All analyses were stratified by sex. The analyses were conducted in SAS version 9.4 and R version 4.0.2 (R Development Core Team, 2017; SAS Institute Inc, 2013). This study was determined to be exempt from review by the Boston University IRB and reported to the Danish Data Protection Agency by Aarhus University (record number 2015–57-0002).
RESULTS
Descriptive Results
There were 1,606 male suicide cases who had an incident depression diagnosis in Denmark during the study period and there were 4,281 men in the corresponding comparison subcohort. For women, there were 1,168 suicide cases who had a depression diagnosis and there were 7,682 members in the corresponding comparison subcohort. For both men and women, suicide cases were on average older than the comparison subcohort and a greater proportion of cases were employed and married or in a registered partnership at baseline (Table 1). There was a slightly larger proportion of immigrants in the subcohort than cases for both sexes.
Table 1.
Demographic characteristics of the suicide cases and the comparison subcohort, Denmark, January 1, 1995.
| Men | Women | |||||||
|---|---|---|---|---|---|---|---|---|
|
| ||||||||
| Variable | Suicide cases (n = 1,606) | Comparison subcohort (n = 4,281) | Suicide cases (n = 1,168) | Comparison subcohort (n = 7,682) | ||||
|
| ||||||||
| Mean | SD | Mean | SD | Mean | SD | Mean | SD | |
|
| ||||||||
| Age, mean (SD) | 43 | 17 | 42 | 21 | 45 | 18 | 43 | 24 |
|
| ||||||||
| N | % | N | % | N | % | N | % | |
|
Marital status, N (%) | ||||||||
| Single | 663 | 41 | 1843 | 43 | 347 | 30 | 2974 | 39 |
| Married or registered partnership | 712 | 44 | 1834 | 43 | 538 | 46 | 2833 | 37 |
| Divorced/separated/widowed | 231 | 14 | 604 | 14 | 283 | 24 | 1875 | 24 |
| Immigrant, N (%) | 48 | 3 | 206 | 4.8 | 46 | 3.9 | 329 | 4.3 |
| Employment status | ||||||||
| Employed | 925 | 58 | 1994 | 47 | 489 | 42 | 2465 | 32 |
| Unemployed | 165 | 10 | 451 | 11 | 135 | 12 | 777 | 10 |
| Early retirement | 127 | 8 | 365 | 8.5 | 136 | 12 | 769 | 10 |
| State pension | 276 | 17 | 923 | 22 | 315 | 27 | 2448 | 32 |
| Age <=14 years | 58 | 3.6 | 507 | 12 | 51 | 4.4 | 1150 | 15 |
| Missing | 55 | 3.4 | 41 | 0.96 | 42 | 3.6 | 73 | 0.95 |
Classification Trees
Among men with depression, the highest risk of suicide was found in persons with a diagnosis of poisoning by, adverse effect of, and underdosing of drugs, medications, and biological substances (hereafter referred to as “poisoning” and may capture suicide attempts) in the preceding six and 48 months, but without recorded prescriptions for hypnotics and sedatives (e.g., benzodiazepines) in the preceding six months (n = 123; risk = 87%). The next highest risk group was men who were prescribed hypnotics and sedatives in the preceding six months, prescribed other analgesics and antipyretics (e.g., non-opioid analgesics; acetaminophen) in the preceding 48 months, and were diagnosed with poisoning in the preceding 48 months (n = 96; risk = 81%). However, there was a much lower suicide risk among men who were prescribed other analgesics and antipyretics in the preceding twelve months but were not prescribed hypnotics and sedatives and anxiolytics and were not diagnosed with poisoning in the preceding 48 months (n = 540; risk = 11%). Figure 1 shows other combinations of characteristics associated with suicide in men with depression (AUC = 0.71 [95% CI = 0.69, 0.73]).
Figure 1. Classification tree depicting suicide predictors in depressed men in Denmark, 1995 – 2015.
Note: aPoisoning by, adverse effect of and underdosing of drugs, medicaments and biological substances. bReaction to severe stress, and adjustment disorders. Each shaded rectangular bin at the bottom (terminal node) represents the group of people with the characteristic profile in the branches above. Within the rectangular bins, n=the number of people who had the characteristic profile and risk=the proportion of people in that bin who died by suicide.
The highest risk of suicide among women with depression was in those who had a poisoning diagnosis in the preceding 48 months and were prescribed anxiolytics in the preceding 12 months (n = 438; risk = 91%). The second highest risk was found in women who had a poisoning diagnosis in the preceding 48 months and were not prescribed anxiolytics in the preceding 12 months nor hormonal contraceptives for systemic use in the preceding six months (n = 405; risk = 82%). Women who were prescribed anxiolytics in the preceding 12 months, hypnotics and sedatives in the preceding six months, and other analgesics and antipyretics in the preceding six months (but who did not have a poisoning diagnosis nor a cerebrovascular disease diagnosis in the preceding 48 months; n = 338) had a 58% risk of suicide. Other combinations of variables associated with suicide among women with depression are displayed in Figure 2 (AUC = 0.74 [95% CI = 0.72, 0.76]).
Figure 2. Classification tree depicting suicide predictors in depressed women in Denmark, 1995 – 2015.
Note: aPoisoning by, adverse effect of and underdosing of drugs, medicaments and biological substances. bAplastic and other anemias and other bone marrow failure syndromes. Each shaded rectangular bin at the bottom (terminal node) represents the group of people with the characteristic profile in the branches above. Within the rectangular bins, n=the number of people who had the characteristic profile and risk=the proportion of people in that bin who died by suicide.
Random Forests
The random forests results for men revealed that the most important predictors were prescriptions of hypnotics and sedatives and anxiolytics and previous poisoning diagnoses at all time intervals. Other important predictive variables among men with depression included prescriptions for other analgesics and antipyretics and antithrombotic agents and antipsychotics and diagnoses of alcohol related disorders and reaction to severe stress and adjustment disorders. Figure 3 displays the top 30 most important predictors after 10-fold cross-validation for men (average MDA value of all predictors = 2.6; standard deviation [SD] = 7.8). The cross-validated AUC for the random forest model for men was 0.70 (95% CI = 0.68, 0.72).
Figure 3. Variable importance of suicide predictors in depressed men in Denmark from 10-fold cross-validation, 1995 – 2015.
Note: aPoisoning by, adverse effect of and underdosing of drugs, medicaments and biological substances. bReaction to severe stress, and adjustment disorders. cGeneral symptoms and signs include fever, headache, pain, malaise, etc. The dots represent the mean decrease in accuracy (MDA) value from 10-fold cross validation. The vertical line represents the average of the MDA values of all predictors (average = 2.6; standard deviation = 7.8).
Among women with depression, the most important predictors were receipt of state pension, prescriptions for psychiatric medications (anxiolytics and antipsychotics) and diagnoses of poisoning. Prescriptions of antithrombotic agents, other analgesics and antipyretics, and hormonal contraceptives for systemic use (a marker of relationship status) emerged as important predictors of suicide among women diagnosed with depression. Other important predictors included alcohol related disorders and reaction to severe stress and adjustment disorders. Figure 4 displays the top 30 most important predictors among women (average MDA value of all predictors = 39 [SD = 6]). The cross-validated AUC for the random forest model for women was 0.75 (95% CI = 0.73, 0.78).
Figure 4. Variable importance of suicide predictors in depressed women in Denmark from 10-fold cross-validation, 1995 – 2015.

Note: aPoisoning by, adverse effect of and underdosing of drugs, medicaments and biological substances. bReaction to severe stress, and adjustment disorders. The dots represent the mean decrease in accuracy (MDA) value from 10-fold cross validation. The vertical line represents the average of the MDA values of all predictors (average = 39; standard deviation = 6).
Men in the top 5%, 10%, and 20% of predicted risk accounted for 14%, 26%, and 44% of all suicide cases among men, respectively. Men in the bottom 95%, 90%, and 80% of predicted suicide risk accounted for 98%, 96%, and 89% of all men who did not die by suicide, respectively. Women in the top 5%, 10%, and 20% of predicted risk accounted for 26%, 41%, and 62% of all suicide cases among women, respectively. Women in the bottom 95%, 90%, and 80% of predicted suicide risk accounted for 98%, 95%, and 86% of all women who did not die by suicide, respectively.
DISCUSSION
This study is among the first to develop machine learning suicide prediction models in a high-risk sample specifically focused on persons with depression. We identified similar patient characteristics that distinguished those at high risk of suicide among men and women with depression, with greater model predictive performance among women than men. Among men, there was an interaction between other analgesics and antipyretics (e.g., acetaminophen), hypnotics and sedatives, and previous poisonings associated with a high risk of suicide. However, these anti-inflammatory medications were not associated with a high risk of suicide in the absence of these additional psychiatric factors (i.e., hypnotics and sedatives and previous poisonings). In women, the most important predictor was state pension, which may reflect the social isolation associated with late adulthood (due to widowhood, diminished social ties and obligations, end of careers, and declining health) that may confer suicide risk (Durkheim, 1897; Girard, 1993). Among women, we observed a high suicide risk in those who were prescribed anti-inflammatory medications and had psychiatric factors (e.g., anxiolytics and hypnotics and sedatives). The random forests models also identified anti-inflammatory medications as important predictors of suicide in both sexes.
Anti-inflammatory medications such as acetaminophen (also known as paracetamol) are used to treat acute and chronic pain and illnesses which in themselves are associated with an increased suicide risk (Dickens et al., 2006; Frasure-Smith et al., 1995; Larsen Karen Kjær et al., 2010; Lespérance & Frasure-Smith, 2000). Addressing the chronic pain and illnesses that underlie the use of acetaminophen may mitigate suicide risk. In addition, the use of acetaminophen in deliberate self-poisoning is well-documented (Møller et al., 2004; Morthorst et al., 2020), and overdose of this medication may potentially lead to life-threatening acute liver failure (Larson et al., 2005). Given the known risks of hepatotoxicity when ingesting excessive quantities of acetaminophen, numerous European countries (e.g., Austria, Belgium, Denmark, etc.) have implemented pack size restrictions of analgesics sold over-the-counter in pharmacies or banned sales of acetaminophen in non-pharmacy outlets (Morthorst et al., 2018, 2020), which have been associated with large reductions in overall overdoses and suicide deaths from acetaminophen overdose (Hawton et al., 2004, 2013). However, no comparable restrictions exist in the United States (U.S.) where nearly unlimited quantities of anti-inflammatory medications may be purchased in pharmacy and non-pharmacy outlets (Bromer & Black, 2003). Although firearms are the most common means of suicide in the U.S., drug poisonings are also an important source of suicide mortality (Centers for Disease Control and Prevention, 2019). Between 2012 and 2018, the rate of suicide-related cases involving over-the-counter acetaminophen increased by approximately 55% in the U.S. (Hopkins et al., 2020). Despite our inability to directly examine ant-inflammatory medications as a means of suicide in this study, it is important for future research to examine the impact of limiting access to large quantities of anti-inflammatory medications on suicide rates in the U.S. as a prevention strategy.
Persons in the top 20% of highest predicted suicide risk in the random forests accounted for a large proportion of suicide cases (44% in men and 62% in women). This suggests that a suicide prevention program delivered to 20% of persons with the highest predicted risk could capture a large proportion of persons who would otherwise die by suicide. Our findings are aligned with previous studies that have found that predictive models may be clinically useful for stratifying risk of suicide. For example, one study found that risk stratification using predictive models for suicidal behavior developed from electronic medical records were more accurate than clinician risk assessment for suicidal behavior, indicating that predictive modeling may enhance identification of high-risk patients (Tran et al., 2014). Practicably, various prevention strategies could be targeted to persons in the highest strata of suicide risk including psychotherapeutic interventions, pharmacotherapeutic interventions, and community approaches (Hofstra et al., 2020). Our findings suggest that predictive models may be a promising approach for suicide risk identification, though additional future work is necessary to examine: 1) how a suicide risk stratification algorithm may be applied in clinical practice, 2) its ability to cost-effectively target interventions to high-risk persons, and 3) its impact on suicide rates.
This study has several limitations. First, we did not include diagnoses prior to 1995 and therefore we may be missing psychiatric and somatic diagnoses prior to the beginning of the study period. We chose 1995 as the start of the study period because it coincided with the switch from ICD-8 to ICD-10 and the inclusion of outpatient visits to the somatic and psychiatric registries (Schmidt et al., 2015). Missing data prior to 1995 may have a limited impact on our results because we defined predictors in a time-varying fashion with the largest time interval being 0–48 months prior to suicide. Thus, missing data before 1995 would only impact the small proportion of persons who died by suicide within the first four years of the study period. Relatedly, there may be a mixture of prevalent and incident depression cases at the beginning of the study period, but this is also expected to have a negligible impact on our results. Second, there may be measurement error of suicide. We expect there to be near perfect specificity of suicide classification since most people who did not die by suicide would be classified as such. Given that the outcome is rare and specificity is high, any misclassification of suicide deaths would have a limited biasing effect. Future work should implement quantitative bias analysis to quantify the impact of measurement error on study results (Jiang et al., 2021). Third, although classification trees and random forests were chosen for their ability to model complex interactions, there may be other machine learning methods that perform better (Chen et al., 2020; Kessler et al., 2015, 2017). Fourth, our machine learning analyses were unable to discern the causal relations between the predictors and suicide. Finally, our models were not externally validated, and future work is necessary to assess generalizability.
This study is an important step towards advancing suicide prediction in a high-risk group comprised of persons with depression. Notably, and practicably, we showed that anti-inflammatory medications were strong predictors of suicide using data from Danish registries, which routinely collect high-quality data on health and life events in a setting of universal healthcare (Schmidt et al., 2019). Additional work is necessary to understand how preventing chronic pain and illnesses may reduce suicide risk and the potential impact of interventions to reduce access to large quantities of anti-inflammatory medications such as acetaminophen on suicide risk in settings such as the U.S.
Supplementary Material
Acknowledgments:
This work was supported by NIMH grant # R01MH109507 (PI: Gradus), NIMH grant # 1R01MH110453–01A1 (PI: Gradus) and grant # R248–2017-521 from the Lundbeck Foundation (PI: Sørensen).The funding source had no role in the design and conduct of the study; collection, management, analysis, and interpretation of the data; preparation, review, or approval of the manuscript; and decision to submit the manuscript for publication.
Footnotes
Disclosures: The authors do not have any conflicts of interest to disclose.
Publisher's Disclaimer: This is a PDF file of an unedited manuscript that has been accepted for publication. As a service to our customers we are providing this early version of the manuscript. The manuscript will undergo copyediting, typesetting, and review of the resulting proof before it is published in its final form. Please note that during the production process errors may be discovered which could affect the content, and all legal disclaimers that apply to the journal pertain.
References
- Adams R, Jiang T, Rosellini AJ, Horváth-Puhó E, Street AE, Keyes KM, Cerdá M, Lash TL, Sørensen HT, & Gradus JL (2021). Sex‐Specific Risk Profiles for Suicide Among Persons with Substance Use Disorders in Denmark. Addiction. 10.1111/add.15455 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Baadsgaard M, & Quitzau J (2011). Danish registers on personal income and transfer payments. Scandinavian Journal of Public Health, 39(7 Suppl), 103–105. 10.1177/1403494811405098 [DOI] [PubMed] [Google Scholar]
- Bergmans RS, Kelly KM, & Mezuk B (2019). Inflammation as a unique marker of suicide ideation distinct from depression syndrome among U.S. adults. Journal of Affective Disorders, 245, 1052–1060. 10.1016/j.jad.2018.11.046 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Bostwick JM, & Pankratz VS (2000). Affective disorders and suicide risk: A reexamination. The American Journal of Psychiatry, 157(12), 1925–1932. 10.1176/appi.ajp.157.12.1925 [DOI] [PubMed] [Google Scholar]
- Brundin L, Bryleva EY, & Thirtamara Rajamani K (2017). Role of Inflammation in Suicide: From Mechanisms to Treatment. Neuropsychopharmacology, 42(1), 271–283. 10.1038/npp.2016.116 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Brundin L, Erhardt S, Bryleva EY, Achtyes ED, & Postolache TT (2015). The role of inflammation in suicidal behaviour. Acta Psychiatrica Scandinavica, 132(3), 192–203. 10.1111/acps.12458 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Centers for Disease Control and Prevention. (2019, August6). WISQARS (Web-based Injury Statistics Query and Reporting System). https://www.cdc.gov/injury/wisqars/index.html
- Chen Q, Zhang-James Y, Barnett EJ, Lichtenstein P, Jokinen J, D’Onofrio BM, Faraone SV, Larsson H, & Fazel S (2020). Predicting suicide attempt or suicide death following a visit to psychiatric specialty care: A machine learning study using Swedish national registry data. PLOS Medicine, 17(11), e1003416. 10.1371/journal.pmed.1003416 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Conwell Y, Duberstein PR, Cox C, Herrmann JH, Forbes NT, & Caine ED (1996). Relationships of age and axis I diagnoses in victims of completed suicide: A psychological autopsy study. The American Journal of Psychiatry, 153(8), 1001–1008. 10.1176/ajp.153.8.1001 [DOI] [PubMed] [Google Scholar]
- Dickens CM, McGowan L, Percival C, Tomenson B, Cotter L, Heagerty A, & Creed FH (2006). Contribution of depression and anxiety to impaired health-related quality of life following first myocardial infarction. The British Journal of Psychiatry: The Journal of Mental Science, 189, 367–372. 10.1192/bjp.bp.105.018234 [DOI] [PubMed] [Google Scholar]
- Doupnik SK, Rudd B, Schmutte T, Worsley D, Bowden CF, McCarthy E, Eggan E, Bridge JA, & Marcus SC (2020). Association of Suicide Prevention Interventions With Subsequent Suicide Attempts, Linkage to Follow-up Care, and Depression Symptoms for Acute Care Settings: A Systematic Review and Meta-analysis. JAMA Psychiatry, 77(10), 1021–1030. 10.1001/jamapsychiatry.2020.1586 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Durkheim E (1897). Suicide. Routledge and Kegan Paul. [Google Scholar]
- Fazel S, & O’Reilly L (2019). Machine Learning for Suicide Research-Can It Improve Risk Factor Identification? JAMA Psychiatry. https://www.ncbi.nlm.nih.gov/pubmed/31642876 [DOI] [PMC free article] [PubMed]
- Ferrari AJ, Charlson FJ, Norman RE, Patten SB, Freedman G, Murray CJL, Vos T, & Whiteford HA (2013). Burden of Depressive Disorders by Country, Sex, Age, and Year: Findings from the Global Burden of Disease Study 2010. PLOS Medicine, 10(11), e1001547. 10.1371/journal.pmed.1001547 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Franklin JC, Ribeiro JD, Fox KR, Bentley KH, Kleiman EM, Huang X, Musacchio KM, Jaroszewski AC, Chang BP, & Nock MK (2017). Risk factors for suicidal thoughts and behaviors: A meta-analysis of 50 years of research. Psychological Bulletin, 143(2), 187–232. 10.1037/bul0000084 [DOI] [PubMed] [Google Scholar]
- Frasure-Smith N, Lespérance F, & Talajic M (1995). Depression and 18-month prognosis after myocardial infarction. Circulation, 91(4), 999–1005. [DOI] [PubMed] [Google Scholar]
- Girard C (1993). Age, Gender, and Suicide: A Cross-National Analysis. American Sociological Review, 58(4), 553–574. 10.2307/2096076 [DOI] [Google Scholar]
- Goldstein RB, Black DW, Nasrallah A, & Winokur G (1991). The Prediction of Suicide: Sensitivity, Specificity, and Predictive Value of a Multivariate Model Applied to Suicide Among 1906 Patients With Affective Disorders. Archives of General Psychiatry, 48(5), 418–422. 10.1001/archpsyc.1991.01810290030004 [DOI] [PubMed] [Google Scholar]
- Gradus JL, Rosellini AJ, Horváth-Puhó E, Street AE, Galatzer-Levy IR, Jiang T, Lash TL, & Sørensen HT (2020). Prediction of Sex-Specific Suicide Risk Using Machine Learning and Single-Payer Health Care Registry Data From Denmark. JAMA Psychiatry, 77(1), 25–34. 10.1001/jamapsychiatry.2019.2905 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Harwood D, Hawton K, Hope T, & Jacoby R (2001). Psychiatric disorder and personality factors associated with suicide in older people: A descriptive and case-control study. International Journal of Geriatric Psychiatry, 16(2), 155–165. [DOI] [PubMed] [Google Scholar]
- Hasin DS, Sarvet AL, Meyers JL, Saha TD, Ruan WJ, Stohl M, & Grant BF (2018). Epidemiology of Adult DSM-5 Major Depressive Disorder and Its Specifiers in the United States. JAMA Psychiatry, 75(4), 336–346. 10.1001/jamapsychiatry.2017.4602 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Helweg-Larsen K (2011). The Danish Register of Causes of Death. Scandinavian Journal of Public Health, 39(7 Suppl), 26–29. 10.1177/1403494811399958 [DOI] [PubMed] [Google Scholar]
- Henriksson MM, Aro HM, Marttunen MJ, Heikkinen ME, Isometsä ET, Kuoppasalmi KI, & Lönnqvist JK (1993). Mental disorders and comorbidity in suicide. The American Journal of Psychiatry, 150(6), 935–940. 10.1176/ajp.150.6.935 [DOI] [PubMed] [Google Scholar]
- Hofstra E, van Nieuwenhuizen C, Bakker M, Özgül D, Elfeddali I, de Jong SJ, & van der Feltz-Cornelis CM (2020). Effectiveness of suicide prevention interventions: A systematic review and meta-analysis. General Hospital Psychiatry, 63, 127–140. 10.1016/j.genhosppsych.2019.04.011 [DOI] [PubMed] [Google Scholar]
- Hopkins AG, Spiller HA, Kistamgari S, Zhu M, Michaels NL, Funk AR, & Smith GA (2020). Suicide-related over-the-counter analgesic exposures reported to United States poison control centers, 2000–2018. Pharmacoepidemiology and Drug Safety, 29(9), 1011–1021. 10.1002/pds.4997 [DOI] [PubMed] [Google Scholar]
- Isometsä ET, Henriksson MM, Aro HM, Heikkinen ME, Kuoppasalmi KI, & Lönnqvist JK (1994). Suicide in major depression. The American Journal of Psychiatry, 151(4), 530–536. 10.1176/ajp.151.4.530 [DOI] [PubMed] [Google Scholar]
- James G, Witten D, Hastie T, & Tibshirani R (2013). An Introduction to Statistical Learning: With Applications in R. Springer-Verlag. //www.springer.com/us/book/9781461471370 [Google Scholar]
- Jiang T, Gradus JL, Lash TL, & Fox MP (2021). Addressing Measurement Error in Random Forests using Quantitative Bias Analysis. American Journal of Epidemiology, kwab010. 10.1093/aje/kwab010 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Jiang T, Rosellini AJ, Horváth-Puhó E, Shiner B, Street AE, Lash TL, Sørensen HT, & Gradus JL (2021). Using machine learning to predict suicide in the 30 days after discharge from psychiatric hospital in Denmark. The British Journal of Psychiatry, 1–8. 10.1192/bjp.2021.19 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Keaton SA, Madaj ZB, Heilman P, Smart L, Grit J, Gibbons R, Postolache TT, Roaten K, Achtyes ED, & Brundin L (2019). An inflammatory profile linked to increased suicide risk. Journal of Affective Disorders, 247, 57–65. 10.1016/j.jad.2018.12.100 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Kessler RC, Stein MB, Petukhova MV, Bliese P, Bossarte RM, Bromet EJ, Fullerton CS, Gilman SE, Ivany C, Lewandowski-Romps L, Bell AM, Naifeh JA, Nock MK, Reis BY, Rosellini AJ, Sampson NA, Zaslavsky AM, & Ursano RJ (2017). Predicting suicides after outpatient mental health visits in the Army Study to Assess Risk and Resilience in Servicemembers (Army STARRS). Molecular Psychiatry, 22(4), 544–551. 10.1038/mp.2016.110 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Kessler RC, Stein MB, Petukhova MV, Bliese P, Bossarte RM, Bromet EJ, Fullerton CS, Gilman SE, Ivany C, Lewandowski-Romps L, Millikan Bell A, Naifeh JA, Nock MK, Reis BY, Rosellini AJ, Sampson NA, Zaslavsky AM, Ursano RJ, & Army STARRS Collaborators. (2017). Predicting suicides after outpatient mental health visits in the Army Study to Assess Risk and Resilience in Servicemembers (Army STARRS). Molecular Psychiatry, 22(4), 544–551. 10.1038/mp.2016.110 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Kessler RC, Warner CH, Ivany C, Petukhova MV, Rose S, Bromet EJ, Brown M, Cai T, Colpe LJ, Cox KL, Fullerton CS, Gilman SE, Gruber MJ, Heeringa SG, Lewandowski-Romps L, Li J, Millikan-Bell AM, Naifeh JA, Nock MK, … Ursano RJ (2015). Predicting Suicides After Psychiatric Hospitalization in US Army Soldiers: The Army Study to Assess Risk and Resilience in Servicemembers (Army STARRS). JAMA Psychiatry, 72(1), 49–57. 10.1001/jamapsychiatry.2014.1754 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Kildemoes HW, Sørensen HT, & Hallas J (2011). The Danish National Prescription Registry. Scandinavian Journal of Public Health, 39(7 Suppl), 38–41. 10.1177/1403494810394717 [DOI] [PubMed] [Google Scholar]
- Kuhn M (2008). Building Predictive Models in R Using the caret Package. Journal of Statistical Software, 28(1), 1–26. 10.18637/jss.v028.i0527774042 [DOI] [Google Scholar]
- Kuhn M, & Johnson K (2013). Remedies for Severe Class Imbalance. In Kuhn M & Johnson K (Eds.), Applied Predictive Modeling (pp. 419–443). Springer; New York. 10.1007/978-1-4614-6849-3_16 [DOI] [Google Scholar]
- Larsen Karen Kjær, Agerbo Esben, Bo Christensen, Jens Søndergaard, & Mogens Vestergaard. (2010). Myocardial Infarction and Risk of Suicide. Circulation, 122(23), 2388–2393. 10.1161/CIRCULATIONAHA.110.956136 [DOI] [PubMed] [Google Scholar]
- Larson AM, Polson J, Fontana RJ, Davern TJ, Lalani E, Hynan LS, Reisch JS, Schiødt FV, Ostapowicz G, Shakil AO, & Lee WM (2005). Acetaminophen-induced acute liver failure: Results of a United States multicenter, prospective study. Hepatology, 42(6), 1364–1372. 10.1002/hep.20948 [DOI] [PubMed] [Google Scholar]
- LeFevre ML & U.S. Preventive Services Task Force. (2014). Screening for suicide risk in adolescents, adults, and older adults in primary care: U.S. Preventive Services Task Force recommendation statement. Annals of Internal Medicine, 160(10), 719–726. 10.7326/M14-0589 [DOI] [PubMed] [Google Scholar]
- Lespérance F, & Frasure-Smith N (2000). Depression in patients with cardiac disease: A practical review. Journal of Psychosomatic Research, 48(4–5), 379–391. [DOI] [PubMed] [Google Scholar]
- Minkoff K, Bergman E, Beck AT, & Beck R (1973). Hopelessness, depression, and attempted suicide. The American Journal of Psychiatry, 130(4), 455–459. 10.1176/ajp.130.4.455 [DOI] [PubMed] [Google Scholar]
- Miranda-Mendizabal A, Castellví P, Parés-Badell O, Alayo I, Almenara J, Alonso I, Blasco MJ, Cebrià A, Gabilondo A, Gili M, Lagares C, Piqueras JA, Rodríguez-Jiménez T, Rodríguez-Marín J, Roca M, Soto-Sanz V, Vilagut G, & Alonso J (2019). Gender differences in suicidal behavior in adolescents and young adults: Systematic review and meta-analysis of longitudinal studies. International Journal of Public Health, 64(2), 265–283. 10.1007/s00038-018-1196-1 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Møller LR, Nielsen GL, Olsen ML, Thulstrup AM, Mortensen JT, & Sørensen HT (2004). Hospital discharges and 30-day case fatality for drug poisoning: A Danish population-based study from 1979 to 2002 with special emphasis on paracetamol. European Journal of Clinical Pharmacology, 59(12), 911–915. 10.1007/s00228-003-0713-0 [DOI] [PubMed] [Google Scholar]
- Möller-Leimkühler AM (2003). The gender gap in suicide and premature death or: Why are men so vulnerable? European Archives of Psychiatry and Clinical Neuroscience, 253(1), 1–8. 10.1007/s00406-003-0397-6 [DOI] [PubMed] [Google Scholar]
- Mors O, Perto GP, & Mortensen PB (2011). The Danish Psychiatric Central Research Register. Scandinavian Journal of Public Health, 39(7 Suppl), 54–57. 10.1177/1403494810395825 [DOI] [PubMed] [Google Scholar]
- Morthorst BR, Erlangsen A, Chaine M, Eriksson F, Hawton K, Dalhoff K, & Nordentoft M (2020). Restriction of non-opioid analgesics sold over-the-counter in Denmark: A national study of impact on poisonings. Journal of Affective Disorders, 268, 61–68. 10.1016/j.jad.2020.02.043 [DOI] [PubMed] [Google Scholar]
- Olfson M, & Klerman GL (1992). The treatment of depression: Prescribing practices of primary care physicians and psychiatrists. Journal of Family Practice, 35(6), 627–636. [PubMed] [Google Scholar]
- Oquendo MA, & Volkow ND (2018). Suicide: A Silent Contributor to Opioid-Overdose Deaths. New England Journal of Medicine, 378(17), 1567–1569. 10.1056/NEJMp1801417 [DOI] [PubMed] [Google Scholar]
- Pedersen CB (2011). The Danish Civil Registration System. Scandinavian Journal of Public Health, 39(7 Suppl), 22–25. 10.1177/1403494810387965 [DOI] [PubMed] [Google Scholar]
- Pottegård A, Schmidt SAJ, Wallach-Kildemoes H, Sørensen HT, Hallas J, & Schmidt M (2017). Data Resource Profile: The Danish National Prescription Registry. International Journal of Epidemiology, 46(3), 798–798f. 10.1093/ije/dyw213 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Prentice RL (1986). A Case-Cohort Design for Epidemiologic Cohort Studies and Disease Prevention Trials. Biometrika, 73(1), 1–11. JSTOR. 10.2307/2336266 [DOI] [Google Scholar]
- R Development Core Team. (2017). R: A language and environment for statistical computing [R Foundation for Statistical Computing; ]. https://www.R-project.org/ [Google Scholar]
- Ribeiro JD, Huang X, Fox KR, & Franklin JC (2018). Depression and hopelessness as risk factors for suicide ideation, attempts and death: Meta-analysis of longitudinal studies. The British Journal of Psychiatry: The Journal of Mental Science, 212(5), 279–286. 10.1192/bjp.2018.27 [DOI] [PubMed] [Google Scholar]
- Robin X, Turck N, Hainard A, Tiberti N, Lisacek F, Sanchez J-C, & Müller M (2011). pROC: An open-source package for R and S+ to analyze and compare ROC curves. BMC Bioinformatics, 12, 77. 10.1186/1471-2105-12-77 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Rothman KJ, Greenland S, & Lash TL (2008). Modern Epidemiology (4th ed.). Lippincott Williams & Wilkins. [Google Scholar]
- SAS Institute Inc. (2013). SAS/GRAPH 9.4.
- Schmidt M, Schmidt SAJ, Adelborg K, Sundbøll J, Laugesen K, Ehrenstein V, & Sørensen HT (2019). The Danish health care system and epidemiological research: From health care contacts to database records. Clinical Epidemiology, 11, 563–591. 10.2147/CLEP.S179083 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Schmidt M, Schmidt SAJ, Sandegaard JL, Ehrenstein V, Pedersen L, & Sørensen HT (2015). The Danish National Patient Registry: A review of content, data quality, and research potential. Clinical Epidemiology, 7, 449–490. 10.2147/CLEP.S91125 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Strobl C, Malley J, & Tutz G (2009). An Introduction to Recursive Partitioning: Rationale, Application and Characteristics of Classification and Regression Trees, Bagging and Random Forests. Psychological Methods, 14(4), 323–348. 10.1037/a0016973 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Therneau T, Atkinson B, port BR (producer of the initial R., & maintainer 1999–2017). (2019). rpart: Recursive Partitioning and Regression Trees (4.1–15) [Computer software]. https://CRAN.R-project.org/package=rpart
- Timmermans B (2010). The Danish Integrated Database for Labor Market Research: Towards Demystification for the English Speaking Audience (No. 10–16; DRUID Working Papers). DRUID, Copenhagen Business School, Department of Industrial Economics and Strategy/Aalborg University, Department of Business Studies. https://ideas.repec.org/p/aal/abbswp/10-16.html [Google Scholar]
- Tøllefsen IM, Helweg-Larsen K, Thiblin I, Hem E, Kastrup MC, Nyberg U, Rogde S, Zahl P-H, Østevold G, & Ekeberg Ø (2015). Are suicide deaths under-reported? Nationwide re-evaluations of 1800 deaths in Scandinavia. BMJ Open, 5(11), e009120. 10.1136/bmjopen-2015-009120 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Tran T, Luo W, Phung D, Harvey R, Berk M, Kennedy RL, & Venkatesh S (2014). Risk stratification using data from electronic medical records better predicts suicide risks than clinician assessments. BMC Psychiatry, 14(1), 76. 10.1186/1471-244X-14-76 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Valenstein M, Taylor KK, Austin K, Kales HC, McCarthy JF, & Blow FC (2004). Benzodiazepine Use Among Depressed Patients Treated in Mental Health Settings. American Journal of Psychiatry, 161(4), 654–661. 10.1176/appi.ajp.161.4.654 [DOI] [PubMed] [Google Scholar]
- Van Orden KA, Witte TK, Cukrowicz KC, Braithwaite S, Selby EA, & Joiner TE (2010). The Interpersonal Theory of Suicide. Psychological Review, 117(2), 575–600. 10.1037/a0018697 [DOI] [PMC free article] [PubMed] [Google Scholar]
- World Health Organization. (2019). Suicide data. World Health Organization. http://www.who.int/mental_health/prevention/suicide/suicideprevent/en/ [Google Scholar]
- World Health Organization. (2021). One in 100 deaths is by suicide. https://www.who.int/news/item/17-06-2021-one-in-100-deaths-is-by-suicide
- Wright MN, & Ziegler A (2017). ranger: A Fast Implementation of Random Forests for High Dimensional Data in C++ and R. Journal of Statistical Software, 77(1), 1–17. 10.18637/jss.v077.i01 [DOI] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.



