Despite strong evidence for the effectiveness of a range of interventions to improve the health and wellbeing of people who are dependent on opioids, morbidity and mortality in this population remains higher than that of the general population. There is a need for innovative approaches to monitor and improve the quality use and safety of available medicines, and to better understand risk factors impacting adverse outcomes in this population. In this thesis, routinely collected administrative data on people with opioid dependence in New South Wales (NSW), Australia, were used to investigate medicine use, including Opioid Agonist Treatment (OAT), opioid analgesics, and other psychotropic medicines. Studies in this thesis examined novel methodological approaches to evaluate medicine exposure and quantify risk, both observed and predicted. This thesis used a diverse range of data sources, including controlled drug registries and pharmaceutical claims databases, linked with health service use and mortality records; and implemented a range of statistical methodologies, including generalised estimating equations, Cox proportional hazards models, and deep learning algorithms. Specifically, this thesis aimed to: (i) estimate retention in OAT and identify person, treatment, and prescriber characteristics that are associated with retention; (ii) develop, evaluate and compare models predicting OAT cessation risk at entry to treatment; (iii) examine trends in opioid analgesic utilisation during periods in and out of OAT; (iv) review methods for generating exposure periods from pharmaceutical dispensing data; and (v) evaluating the all-cause and cause-specific mortality risk associated with opioid analgesics, benzodiazepines, gabapentinoids, and OAT. The first study found retention in OAT to be affected not only by characteristics of the person and their treatment, but also of their prescriber, with longer prescribing tenure associated with increased retention of people in OAT. The results from the second study indicated time-to-event prediction models may be limited in their ability to identify individuals at high cessation risk on entry to OAT. Of the methods used in model development, machine learning approaches performed similarly to traditional statistical methods. In the third study, people with opioid dependence were found to have high rates of recent psychotropic medicine utilisation at the time of opioid analgesic initiation, and reduced opioid analgesic dispensing while engaged in OAT. The fourth study describes a novel method for generating medicine exposure periods from dispensing claims data, developed especially for application to medicines with complex and variable dosing regimens. Finally, in the fifth study, benzodiazepines and gabapentinoids appear to increase mortality risk when used in combination with opioid analgesics, although the risk may be reduced when engaged in OAT. This thesis demonstrates the utility of person-level data linkage and innovative analytical methods to generate real-world evidence about the use and outcomes of prescribed medicines among people with opioid dependence. Awareness of harms in clinical settings and evaluating outcome risk during medicine use would give clinicians the ability to understand who needs prevention and treatment services, ensuring efforts and resources are targeted towards those most at-risk. These represent important strategies for improving quality medicine use and reducing harms among people with opioid dependence.