Development and evaluation of machine learning algorithms for the prediction of opioid-related deaths among UK patients with non-cancer pain
Jose Benitez-Aurioles,
Carlos Raul Ramirez Medina,
David Jenkins,
Niels Peek and
Meghna Jani
PLOS Digital Health, 2026, vol. 5, issue 1, 1-20
Abstract:
The global rise in prescription opioid use has contributed to an opioid epidemic, associated harms, and unintentional deaths in several western countries. Opioids however continue to be regularly prescribed for acute pain and in the chronic pain context due to limited treatment options. Currently there are no accurate tools that help predict which patients prescribed opioids may be at risk of death, which depends on the cultural context and varies across countries. Existing models do not account for statistical considerations such as censoring and competing risks. Using nationally representative data from the United Kingdom from 1,026,139 patients newly prescribed an opioid, we developed three competing risk time-to-event models: a regression model, a random forest, and a deep neural network to predict opioid-related deaths using UK primary care records. The models were externally validated in an external cohort of 337,015 patients. The models exhibited good discrimination and positive predictive value during internal validation (C-statistic for the regression model, random forest, and neural network: 84.3%, 84.4% and 82.1% respectively), and external validation (C-statistic for the regression model, random forest, and neural network: 81.8%, 81.5% and 81.5% respectively). Prior substance abuse, lung and liver comorbidities, morphine, fentanyl, or oxycodone at initiation and co-prescription of gabapentinoids were some of candidate predictors associated with a higher risk of opioid-related mortality within the models. These results demonstrate how routinely collected data from a nationally representative dataset may be used to develop and validate opioids risk algorithms to better help clinicians and patients predict risk to this serious adverse outcome.Author summary: The rising use of prescription opioids has led to serious health concerns, including a growing number of preventable deaths. Yet, opioids remain a common treatment for pain, leaving doctors and patients with a difficult balance between benefits and risks. There are no accurate tools to identify which patients prescribed opioids for non-cancer pain may face a higher risk of dying from them. Using electronic health records from over one million people in the United Kingdom who were newly prescribed an opioid, we created and tested three different prediction models, including different types of machine learning. We were able to accurately define opioid-associated deaths from information presented on death certificates. These models used information such as medical history, other medications taken at the same time, and the type/ dose of opioid prescribed to estimate an individual’s risk of opioid-related death. We found that all three models performed well, both when tested on the original data and when tested on a separate group of patients. We developed and validated risk prediction tools to predict the most serious adverse event to opioids for the first time using nationally representative data. These could help guide safer prescribing decisions and support conversations between patients and healthcare professionals about opioid use.
Date: 2026
References: Add references at CitEc
Citations:
Downloads: (external link)
https://journals.plos.org/digitalhealth/article?id=10.1371/journal.pdig.0001190 (text/html)
https://journals.plos.org/digitalhealth/article/fi ... 01190&type=printable (application/pdf)
Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.
Export reference: BibTeX
RIS (EndNote, ProCite, RefMan)
HTML/Text
Persistent link: https://EconPapers.repec.org/RePEc:plo:pdig00:0001190
DOI: 10.1371/journal.pdig.0001190
Access Statistics for this article
More articles in PLOS Digital Health from Public Library of Science
Bibliographic data for series maintained by digitalhealth ().