*2.3. Variables*

The dependent variable was treatment retention, defined as total days in treatment from the first face-to-face treatment visit to treatment dropout. To our knowledge, there is no standard definition of treatment retention. We considered the definition of treatment dropout of the National Plan of Drugs of the Spanish Government [31], which follows the

European Guidelines [32], that define dropout as a lack of face-to-face contact between the individual and the treatment centre for 6 months. Each year was reviewed to determine whether the individual was in treatment or not (passive status) and the cause of passive status: dropout, therapeutic discharge, referral, or exitus (Latin language term indicating the death of the patient). The treatment procedures protocol of the Barcelona Public Health Agency defines therapeutic discharge as occurring when the individual in treatment has a favourable outcome, without compulsion or thoughts about future or occasional drug consumption, at least in the last 6 months before the date of discharge; referral when the individual is referred to another health service; and exitus when the patient dies. Individuals in treatment at the end of the study follow-up were censored at the end date (28 February 2018). The primary explanatory variable was the result of the DDSI-IV. Other covariates were sociodemographic (sex, age, educational level, living arrangements, employment status, and legal history), clinical (substance of use, frequency and years of substance use, previous substance use treatment, previous psychiatric treatment, medical or psychiatric history, family history of substance use, self-perceived health and treatment centre) and follow-up (number of visits with a physician or psychiatrist, psychologist, or social worker during the study period) (Appendix A, Table A1).

#### *2.4. Statistical Analysis*

We conducted a descriptive analysis of the sample characteristics. We stratified the analyses by the DDSI-IV result, a positive result for one or more mental disorders (dual disorder) or a negative result (AUD or CUD alone, no dual disorder). Sociodemographic and clinical differences between individuals screening positive for DD and individuals with AUD or CUD alone were assessed using Pearson's chi-square test or Fisher's exact test for qualitative/categorical variables, and Student's *t*-test or the Mann–Whitney U test for quantitative variables, using an alpha significance level of 0.05. We estimated Kaplan–Meier survival curves to analyse differences in treatment retention between individuals screening positive for DD and patients with AUD or CUD alone. We studied whether differences were statistically significant using the Wilcoxon and Log-Rank tests.

A multivariable Cox regression model was estimated and was adjusted for potential confounders. Firstly, we estimated a model with the significant variables (*p*-value < 0.2) in the descriptive analysis. We used a manual backward elimination method and theoretical criteria to construct 4 blocks of variables introduced in the model in the following order: explanatory, sociodemographic, clinical and follow-up variables. The final model included explanatory variables (DDSI-IV result and substance of use), sociodemographic variables (sex, age and living arrangements), clinical variables (previous psychiatric treatment) and follow-up variables (visits with a physician/psychiatrist, psychologist or a social worker). Finally, we checked whether the final model met the Cox proportional hazards assumption. We performed all analyses using STATA 14.0 (Lakeway Drive College Station, TX, USA) statistical software.
