Each shaded rectangle at the bottom (terminal node) represents the group of people with the characteristic profile in the branches above. Within the rectangles, n indicates the number of people who had the characteristic profile and suicide indicates the proportion of people in that bin who died by suicide. AD indicates adjustment disorder; RSS, reaction to severe stress.
aDrugs used in addictive disorders.
bPoisoning by adverse effect and underdosing of drugs, medicaments (a substance used for medical treatment), and biological substances.
cReaction to severe stress and adjustment disorders.
Each of the 2 columns of rectangles at the right (terminal node) represents the group of people with the characteristic profile in the branches at left. Within the rectangles, n indicates the number of people who had the characteristic profile and suicide indicates the proportion of people in that bin who died by suicide. MDD indicates major depressive disorder.
aPoisoning, adverse effects, and underdosing of drugs, medicaments (a substance used for medical treatment), and biological substances.
bDrugs used in addictive disorders.
cβ-Lactam antibacterials, penicillins.
The blue dots represent the mean decrease in accuracy (MDA) value in fold 1 and the orange dots represent the MDA value in fold 2. The vertical line is the average of the MDA values of all predictors with nonzero MDA values in folds 1 and 2 (7.80).
aPredictors that were in the top 30 predictors in folds 1 and 2 for men.
The blue dots represent the mean decrease in accuracy (MDA) value in fold 1 and the orange dots represent the MDA value in fold 2. The vertical line is the average of the MDA values of all predictors with nonzero MDA values in folds 1 and 2 (4.61).
aPredictors that were in the top 30 predictors in folds 1 and 2 for women.
eTable. Variables Included in the Analyses
Customize your JAMA Network experience by selecting one or more topics from the list below.
Identify all potential conflicts of interest that might be relevant to your comment.
Conflicts of interest comprise financial interests, activities, and relationships within the past 3 years including but not limited to employment, affiliation, grants or funding, consultancies, honoraria or payment, speaker's bureaus, stock ownership or options, expert testimony, royalties, donation of medical equipment, or patents planned, pending, or issued.
Err on the side of full disclosure.
If you have no conflicts of interest, check "No potential conflicts of interest" in the box below. The information will be posted with your response.
Not all submitted comments are published. Please see our commenting policy for details.
Gradus JL, Rosellini AJ, Horváth-Puhó E, et al. Prediction of Sex-Specific Suicide Risk Using Machine Learning and Single-Payer Health Care Registry Data From Denmark. JAMA Psychiatry. 2020;77(1):25–34. doi:10.1001/jamapsychiatry.2019.2905
What are the sex-specific risk profiles for death from suicide in a general population sample?
In this case-cohort study of 14 103 individuals who died by suicide, risk profiles for suicide were different among men and women in a general population sample of 265 183 persons who did not die by suicide, with physical health more important to men’s than women’s suicide risk. Results suggest psychotropic medications and psychiatric disorders are important to suicide risk and, for many diagnostic variables and prescriptions, a longer vs shorter period of observation (eg, 48 vs 6 months prior to suicide) appeared to be more important.
These findings suggest consistency with what is known about suicide risk but also potentially important, and understudied risk factors with evidence of unique suicide risk profiles among specific subpopulations.
Suicide is a public health problem, with multiple causes that are poorly understood. The increased focus on combining health care data with machine-learning approaches in psychiatry may help advance the understanding of suicide risk.
To examine sex-specific risk profiles for death from suicide using machine-learning methods and data from the population of Denmark.
Design, Setting, and Participants
A case-cohort study nested within 8 national Danish health and social registries was conducted from January 1, 1995, through December 31, 2015. The source population was all persons born or residing in Denmark as of January 1, 1995. Data were analyzed from November 5, 2018, through May 13, 2019.
Exposures included 1339 variables spanning domains of suicide risk factors.
Main Outcomes and Measures
Death from suicide from the Danish cause of death registry.
A total of 14 103 individuals died by suicide between 1995 and 2015 (10 152 men [72.0%]; mean [SD] age, 43.5 [18.8] years and 3951 women [28.0%]; age, 47.6 [18.8] years). The comparison subcohort was a 5% random sample (n = 265 183) of living individuals in Denmark on January 1, 1995 (130 591 men [49.2%]; age, 37.4 [21.8] years and 134 592 women [50.8%]; age, 39.9 [23.4] years). With use of classification trees and random forests, sex-specific differences were noted in risk for suicide, with physical health more important to men’s suicide risk than women’s suicide risk. Psychiatric disorders and possibly associated medications were important to suicide risk, with specific results that may increase clarity in the literature. Generally, diagnoses and medications measured 48 months before suicide were more important indicators of suicide risk than when measured 6 months earlier. Individuals in the top 5% of predicted suicide risk appeared to account for 32.0% of all suicide cases in men and 53.4% of all cases in women.
Conclusions and Relevance
Despite decades of research on suicide risk factors, understanding of suicide remains poor. In this study, the first to date to develop risk profiles for suicide based on data from a full population, apparent consistency with what is known about suicide risk was noted, as well as potentially important, understudied risk factors with evidence of unique suicide risk profiles among specific subpopulations.
Suicide is a worldwide contributor to mortality.1 The age-standardized suicide rate of 13 per 100 000 per year in the United States has not decreased in the past 50 years.2,3 Suicide was recently identified as 1 of only 3 causes of death that is increasing in the United States.4 The age-standardized suicide rate in Denmark has been comparable to that in the United States in the past 2 decades, but decreased to 9.2 per 100 000 as of 2016.2
In 2014, the US National Institute of Mental Health and the National Action Alliance for Suicide Prevention Research Prioritization Task Force published a list of research priorities.3 Key questions were identified, including “How can we better or more optimally detect [suicide] risk?”3 This call for research is not surprising given that decades of research have not resulted in improved suicide prediction in clinical settings.5 Sociodemographic characteristics, psychiatric diagnoses, and physical health diagnoses are well-documented risk factors for suicide.6-8 However, most of the research that generated these findings used conventional null hypothesis testing statistical methods,5 and these methods are limited when the goal is accurate identification of a high-risk patient. For instance, logistic regression is not designed to examine large, highly correlated sets of predictors or to elucidate interactions among predictors without a priori specification. Additional research using flexible modeling procedures that capture the complexities of the causes of suicide is needed.
The shift in focus to supervised machine learning methods in psychiatry allows for the development of novel suicide risk profiles that include broad constellations of predictors. Machine learning methods have been used in some small, clinical civilian samples,9-11 and larger samples of Army members, veterans, or civilian hospital patients.12-15 To our knowledge, no study has used machine learning methods to examine suicide risk in a full civilian population. Thus, the goal of this study was to use population-based, prospectively recorded Danish medical and social registry data and supervised machine learning methods to identify risk profiles for death from suicide. Suicide risk differs by many demographic factors.16 Although all factors are important to examine, we chose to focus on sex differences for the purposes of this study, given well-established sex differences in suicide risk.17-19
The source population for this study was all individuals born or residing in Denmark as of January 1, 1995, coinciding with the switch from International Classification of Diseases, 8th Edition, to International Statistical Classification of Diseases and Related Health Problems, Tenth Revision (ICD-10) and the inclusion of outpatient visits in the registries (n = 5 078 382).20 We used a case-cohort study design, consistent with prior machine learning studies of suicide death.12,13,21,22 Individuals considered cases in this study died by suicide between January 1, 1995, and December 31, 2015 (n = 14 103). The comparison subcohort was a 5% random sample of living individuals in Denmark on January 1, 1995 (n = 265 183). Cases and subcohort members were unmatched to allow for maximum variability in predictors for the machine learning analyses. This work was deemed exempt from review by the institutional review board at Boston University because of deidentified data and approved by the Danish Data Protection Agency. Data were analyzed from November 5, 2018, through May 13, 2019.
Universal medical coverage is provided to all residents of Denmark through a tax-funded health care system.20 More than 90% of the Danish population has at least 1 contact with the health care system in a given year.23 Receipt of health care is recorded in medical and administrative registries at the national level.24,25 The 10-digit Central Personal Register number, a unique personal identifier assigned to all residents of Denmark, can be used to merge individual data across 8 registries.
The Danish Civil Registration System was established in 1968. The data have been updated daily since 1989 and are widely accepted as accurate.26-28 For this study we included sex at birth, age, immigration status (yes or no), generation of citizenship, family suicidal behavior (parent or spouse), and marital status.26,27
The Income Statistics Register began in 1970 and contains variables related to income (eg, salary, private pension contributions).29 The Population Education Register contains information on educational level attained for 96.4% of the Danish population.30 The Integrated Database for Labor Market Research contains information about employment beginning in 1980.31
The Danish Psychiatric Central Research Register records all psychiatric inpatient, outpatient, and emergency department treatment data since 1995, including treatment dates and primary and secondary diagnoses.32 We evaluated psychiatric disorders according to 2-digit ICD-10 codes (eg, code F20 was used to capture schizophrenia and its subtypes; code F25 was used to capture schizoaffective disorder). Diagnoses in this registry are documented as high quality.32,33
The Danish National Patient Registry includes treatment date and primary and secondary diagnostic codes, contact type (inpatient, outpatient, emergency), surgical procedure, and selected examination codes.20,34 Diagnoses from this registry were included as second-level ICD-10 groupings (eg, codes C15-C26 included as 1 variable: malignant neoplasms of digestive organs). Surgery procedure codes were included according to body system (eg, nervous system surgeries). Two validation studies have found high correlations between the data contained in the registry and medical records.20,35
The Danish National Prescription Registry has cataloged data on all prescription drugs sold in Danish pharmacies since 1994.4 The registry includes dispensing date, product name, and Anatomical Therapeutic Classification code. Data for this study were coded according to level 3 Anatomical Therapeutic Classification codes (eTable in the Supplement). Data in the registry are considered complete and valid from 1995.36
The Danish Cause of Death Registry includes age at death and manner of death (eg, natural, suicide), place of death, and autopsy results. Suicide cases were identified via this registry via ICD-10 codes of X60 to X84.37 In a validation study, 90% of the deaths registered as suicides were confirmed by experts.38
Some predictors (eg, natal sex) could be used in their registry-based form, while others (eg, diagnoses, medications) were dummy-coded to create time-varying predictors (ie, intervals of 0-6, 0-12, 0-24, and 0-48 months before the first day of the suicide month). To estimate the prevalence of each predictor in the person-time that gave rise to cases, we randomly selected a date for each member of the subcohort and evaluated the prevalence of predictors at the above time intervals in relation to that date. Predictors from all time points were evaluated simultaneously.
The data reduction process included elimination of rare predictors (≤10 observations13,39) and predictors with negligible associations with suicide (unadjusted odds ratio of <0.9 or ≥1.1). We eliminated diagnoses occurring in the emergency department owing to low positive predictive value.40,41 The initial analytic data set contained 2564 predictor variables. Following data reduction, the final number of included predictors was 1339. The eTable in the Supplement provides considered and retained predictors.
Given our dual interests in identifying novel predictor/interactions and developing algorithms that may accurately predict suicide, we used recursive partitioning machine learning methods that automatize detection of associations between predictors and outcomes and interactions among predictors and provide metrics of predictor importance.42
First, we estimated classification tree (CART) models as an initial evaluation of the data structure.43,44 Classification tree modeling is a nonparametric method that builds a decision tree based on predictors and their combinations that result in the highest probability of differentiating cases from noncases. Classification tree modeling was implemented using the R package, version 3.5.2 rpart (R Foundation), which uses a 10-fold cross-validation procedure.45 To mitigate risk of model overfit and increase visual interpretability, maximum tree depth and minimum number of observations in any node (terminal or parent) were set to 10. Given the class imbalance (sample suicide rate, 5%), CART modeling was implemented using equal priors rather than the rpart default of priors proportional to the outcome frequency.42,46 Risk of suicide was computed for each identified combination of predictors.
Second, we implemented random forest, which is less likely to produce an overfit model than CART modeling because random forest uses bootstrap aggregation, using the R package randomForest.47 Each forest was built with 1000 trees with a minimum of 10 observations needed to attempt a split and 37 variables sampled as split candidates at each node (ie, square root of total number of predictors; randomForest default). Given the class imbalance, each tree was built using all observations of suicide plus a random equally sized number of subcohort observations using the sampsize tuning parameter.48,49 Split-sample cross-validation was used to generate individual-level random forests–predicted values (the analytic server would not permit 10-fold cross-validation of 1000 trees). We used mean decrease in accuracy to evaluate each variable in terms of main effects and interactions across all trees.42
Prediction accuracy was evaluated using receiver operating characteristic curve analysis conducted in 1000 bootstrap replicates to estimate area under the curve (AUC) and its 95% CI.50 Additional operating characteristics were evaluated using high-risk subgroups and thresholds of predicted risk (eg, based on CART terminal nodes; random forests–predicted values). Sensitivity was prioritized in accordance with the goal of identifying suicide cases. Analyses were conducted separately for men and women in SAS, version 9.4 (SAS Institute Inc) and R, version 22.214.171.124,52
Of the 14 103 persons who were suicide cases, 10 152 were men (72.0%), with 130 591 men (49.2%) in the corresponding comparison cohort. The suicide cases included 3951 women (28.0%), with 134 592 women (50.8%) in the corresponding comparison cohort. Persons who died by suicide were slightly older than subcohort members (mean [SD] for men: 43.5  years vs 37.4 [21.8] years; women: 47.6 [18.8] vs 39.9 [23.4] years), more frequently divorced (men: 1225 [12.1%] vs 8228 [6.3%]; women: 682 [17.3%] vs 10 266 [7.6%]), and in the second-income quartile (men: 2516 [24.8%] vs 19 980 [15.3%]; women: 1364 [34.5%] vs 34 114 [25.3%]) (Table).
Among men, the highest risk for suicide was found among those not being treated by pharmacotherapy (eg, antidepressants, antipsychotics, or anxiolytics) and with a prior suicide attempt in the prior 4 years, and being in the second income quartile (n = 18; risk, 1.0). Similarly, men who received a prior diagnosis of poisoning by adverse effects or underdosing of drugs but did not have a coded prescription for antidepressants, antipsychotics, medications for addictions (eg, methadone), or hypnotics/sedatives in the prior 4 years had a risk of 0.42 (n = 251). Other combinations of importance are displayed in Figure 1 (AUC, 0.77; 95% CI, 0.77-0.78).
The highest risk among women was among those who did not have a recorded prescription for anxiolytics, antipsychotics, hypnotics or sedatives, or antidepressants, but made a suicide attempt in the previous 4 years (n = 16; risk, 1.0). Women who were prescribed hypnotic/sedatives and were diagnosed with poisoning by, adverse effect of, and underdosing of drugs in the 4 years before suicide had the next highest risk (n = 79; risk, 0.41). Other combinations of importance are displayed in Figure 2 (AUC, 0.87; 95% CI, 0.86-0.88).
Among men, 90% to 91% (fold 1-fold 2) of the predictors had a mean decrease in accuracy above 0 (mean [SD], 7.8 [5.8]). Eighteen predictors were among the top 30 most important predictors in both folds (Figure 3). Removal of drugs used in addictive disorders 4 years before suicide from our models would have the largest association with accuracy. Other predictors in the top 30 included antidepressants, hypnotics/sedatives, and antipsychotics in the past 4 years, age, physical health diagnoses, and stress disorders. The AUC for the random forest across folds was 0.80 (95% CI, 0.79-0.81).
Among women, 87% to 89% (fold 1 – fold 2) of the total number of predictors had a mean decrease in accuracy above 0 (mean [SD], 4.6 [3.8]). Twenty-one predictors overlapped as a top 30 predictor in both folds, most of which involved psychiatric diagnoses and medications (Figure 4). Specifically, alcohol-related disorders, prior suicide attempts, drugs used in addictive disorders, schizophrenia, recurrent major depression, and stress disorders had the largest association with accuracy. The AUC for the random forest model across folds was 0.88 (95% CI, 0.88-0.89).
Cross-validated random forests–predicted probabilities were rank ordered and operating characteristics were calculated among individuals in the top quintile of the predicted risk distribution. Men in the top 5%, 10%, and 20% of predicted risk accounted (sensitivity) for 32.0%, 49.4%, and 65.9% of all male cases of suicide death, respectively (specificity, 97.1%, 93.1%, 83.6%). Women in the top 5%, 10%, and 20% of predicted risk accounted for 53.4%, 68.1%, and 81.0% of all female suicide deaths (specificity, 96.4%, 91.7%, 81.8%). The sensitivity among individuals in the top 5% of predicted risk was 6.4 times the expected value among men (32%/5%) and 10.6 times the expected value among women (53.4%/5%).
We used supervised machine learning to develop sex-specific risk models for suicide using population-based data from the Danish national health care and social registries. From 2554 predictors, characterized across 4 different timeframes and spanning demographics, family history of suicide, previous suicidal behavior, psychiatric disorders, physical health disorders, and medications, we derived machine learning models that highlight important predictors and combinations.
Across all models, psychiatric disorders emerged as the most important predictors of suicide. This finding is largely consistent with what is known about psychiatric disorders and suicide risk.7,53,54 However, some specific disorders that appeared in our results were novel. While schizophrenia and depression are well-established risk factors for suicide,17,55-60 there is some controversy in the literature with regard to whether stress disorders are a risk factor for suicide aside from depression.61 In these results, stress disorders are an important predictor of suicide among both men and women in models simultaneously evaluating depression. Furthermore, antidepressants, antipsychotics, hypnotics/sedatives, and medications used to treat addictions were important to the accuracy of predicting suicide across analyses. Although our results indicate that pharmacotherapy is important to suicide prediction, our noncausal models could not elucidate the direction or magnitude of associations.
Physical health diagnoses appeared to contribute more to suicide prediction for men than women. Conversely, psychiatric diagnoses and associated medications appeared to contribute more to the prediction of women’s suicide risk. It is possible that clinicians may more frequently assess for, recognize, and diagnose mental health symptoms among women, while these same symptoms may be attributed to somatic concerns among men.62 Previous machine learning work on suicide prediction among men relied on relatively healthy populations (eg, soldiers) and thus did not incorporate a detailed examination of physical health diagnoses.12,13 We believe research will be needed to further examine physical health risk factors for suicide within a causal framework.
This study has some important limitations worth noting. With regard to time-varying prediction, a longer period of observation before suicide (eg, diagnoses that occurred 48 months earlier) was more important to suicide prediction than a shorter period of observation before suicide (eg, diagnoses that occurred 6 months earlier). A limitation of this study is that nondiagnostic predictors occurring in the immediate days before suicide may be particularly important to risk (eg, acute interpersonal stress, loneliness), but these data are not available in the Danish registries. A challenge to epidemiologic studies of suicide in general is obtaining data on the sample size needed to study the causes of this relatively rare event (usually medical registry data), while also obtaining data on negative life factors not typically found in data sources of this size. It is likely that long-term diagnostic risk factors and acute life events and emotional states interact to most accurately characterize suicide risk. How to best capture long-term and acute risk factors in large, population-based samples has been an ongoing challenge to suicide epidemiologic research.
Another limitation to the present study is the reliance on only 2 machine learning classifiers: CART and random forest. We used these approaches to prediction for substantive reasons (ie, variable importance), but other classifiers or meta-classifiers (eg, super learning) could achieve better prediction performance.63 Furthermore, despite our bootstrap and cross-validation approach, spurious findings are still possible. In addition, it is possible that observed sex differences are the result of differences in modeling; thus, these findings should be considered exploratory. Given our case-cohort study design, the risks presented in the CART terminal nodes may not reflect the true population risk. Results from this study should not be interpreted as causal effects. In addition, although there is a rigorous and thorough process for suicide death classification in Denmark (ie, a full inquest into the cause of death), suicide death misclassification is possible. The extent to which these results may generalize to populations outside of Denmark is unclear, although concerns about generalization may be assuaged given that our results are consistent with the existing, primarily US-based, suicide literature.
Despite decades of suicide research, our understanding of suicide risk remains poor. Machine learning may allow for the development of prediction models that can evaluate many relevant predictors of suicide simultaneously. To our knowledge, this study is the first to develop prediction models for suicide based on data from a full population. We found what appears to be consistency with what is known about suicide risk but also potentially important, understudied, predictors for future study. Results of this study can possibly be replicated in other novel data sets and used to inform the further development of general population prediction models for suicide.
Accepted for Publication: July 28, 2019.
Published Online: October 23, 2019. doi:10.1001/jamapsychiatry.2019.2905
Correction: This article was corrected on December 4, 2019, to fix errors in the Abstract, Statistical Analysis, and Results.
Corresponding Author: Jaimie L. Gradus, DMSc, DSc, Department of Epidemiology, Boston University School of Public Health, 715 Albany St, T318E, Boston, MA 02118 (firstname.lastname@example.org).
Author Contributions: Dr Horváth-Puhó had full access to all of the data in the study and takes responsibility for the integrity of the data and the accuracy of the data analysis.
Concept and design: Gradus, Rosellini, Horváth-Puhó, Street, Galatzer-Levy, Lash, Sørensen.
Acquisition, analysis, or interpretation of data: Gradus, Rosellini, Horváth-Puhó, Street, Galatzer-Levy, Jiang.
Drafting of the manuscript: Gradus, Rosellini, Street, Galatzer-Levy, Jiang.
Critical revision of the manuscript for important intellectual content: Gradus, Rosellini, Horváth-Puhó, Street, Jiang, Lash, Sørensen. Statistical analysis: Gradus, Rosellini, Horváth-Puhó, Galatzer-Levy, Jiang.
Obtained funding: Gradus, Galatzer-Levy, Sørensen.
Administrative, technical, or material support: Gradus, Jiang.
Supervision: Gradus, Rosellini, Sørensen.
Conflict of Interest Disclosures: Dr Street reported receiving grants from the National Institute of Mental Health (NIMH) during the conduct of the study. Dr Galatzer-Levy reported support from AiCure outside the submitted work. Dr Lash reported grants from the National Institutes of Health during the conduct of the study. Dr Sørensen reports that the Department of Clinical Epidemiology is involved in studies with funding from various companies as research grants to and administered by Aarhus University. No other disclosures were reported.
Funding/Support: This study was supported by NIMH grants R01MH109507 and 1R01MH110453-01A1 (principal investigator: Dr Gradus).
Role of the Funder/Sponsor: 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.
Create a personal account or sign in to: