Model development
PRS, suicidal behavior
EVENT
The cohort was randomly divided into two equally sized sub-cohorts of training and testing (validation) sets. The training set was used to develop the model and the testing set was used for model validation and evaluation of its performance. As in previous studies [The models included data on demographics, diagnostic codes, lab results (with indication of normal/low/high values), and prescribed medications (true/false values without dosage). Data were collected up to but not including the first suicidal event for the cases, and for all observed time periods for the controls. For each independent input variable in the training dataset (e.g. diagnoses, medications, etc.), we assigned a partial risk score based on the ratio of its prevalence among cases vs. controls. The score was calculated on a logarithmic scale, where negative scores represented “protective” factors (negatively associated with suicidal behavior) and positive scores represented “adverse” risk factors (positively associated with suicidal behavior).Partial Risk Score (PRS) for variable i (e.g. use of specific medication, a lab test, or a certain diagnosis) was calculated using the log of the odds ratio for that variable.The model generates a continuous score that is the sum of all partial risk scores. In preparation for model validation, these continuous results were transformed into a binary outcome of yes/no subject had suicidal behavior based on selecting risk score thresholds using the training set. Thresholds were selected to achieve benchmark specificities of 90% and 95% (ie, choosing the 90% and 95% percentiles of the training controls’ scores as the cutoff score).