Open access peer-reviewed chapter

Leveraging Advanced Analytics to Understand the Impact of the COVID-19 Pandemic on Trends in Substance Use Disorders

Written By

Ewa J. Kleczyk, Jill Bana and Rishabh Arora

Submitted: 22 January 2021 Reviewed: 24 July 2021 Published: 21 September 2021

DOI: 10.5772/intechopen.99639

From the Edited Volume

Addictions - Diagnosis and Treatment

Edited by William M. Meil and John A. Mills

Chapter metrics overview

321 Chapter Downloads

View Full Metrics


Coronavirus disease (COVID-19) caused an overwhelming healthcare, economic, social, and psychological impact on the world during 2020 and first part of 2021. Certain populations, especially those with Substance Use Disorders (SUD), were particularly vulnerable to contract the virus and also likely to suffer from a greater psychosocial and psychological burden. COVID-19 and addiction are two conditions on the verge of a collision, potentially causing a major public health threat. There is surge of addictive behaviors (both new and relapse), including use of alcohol, nicotine, and recreational drugs. This book chapter analyzed the bi-directional relationship between COVID-19 and SUD by leveraging descriptive summaries, advanced analytics, and machine learning approaches. The data sources included healthcare claims dataset as well as state level alcohol consumption to help in investigating the bi-directional relationship between the two conditions. Results suggest that alcohol and nicotine use increased during the pandemic and that the profile of SUD patients included diagnoses and symptoms of COVID-19, depression and anxiety, as well as hypertensive conditions.


  • COVID-19
  • pandemic
  • addiction
  • smoking
  • alcohol
  • opioid addiction
  • public health
  • advanced analytics
  • linear regression
  • machine learning model

1. Introduction

The coronavirus disease (COVID-19) has caused a large healthcare, economic, and psychosocial impact on communities in the United States and around the world in 2020 and first part of 2021. Many communities, especially those with low income and Substance Use Disorders (SUD), were particularly vulnerable to contract the infection and likely to suffered from a greater economic and psychosocial burden [1].

Addiction, characterized by a range of mental, physical, and behavioral symptoms, claims the lives of millions of people every year around the world [2]. In their National Survey on Drug Use and Health, Substance Abuse and Mental Health Services Administration estimated that 22.6 million Americans, 12 years of age or older (9.2% of the population), have SUD, including alcohol and tobacco use [3]. Furthermore, the long-term treatment has challenges to due frequent relapse [4]. Alcohol consumption and drug addiction cost around 1.5% of the global burden of disease, and it can be as high as 5% in some countries, according to recent data [2].

There are two basic settings to treat SUD: inpatient and outpatient. The primary goal is for patients affected by addiction to be in the most effective, yet least restrictive environment that allows them to move along a continuum of care, depending on their personal and medical needs. There are four phases of SUD care: outpatient treatment, intensive outpatient treatment, residential treatment, and inpatient hospitalization [5].

Furthermore, SUD treatment programs are often designed based on three basic models:

  • Psychological model that includes behavioral therapy and treats emotional challenges as the primary cause of SUD.

  • Medical model that requires treatment of SUD symptoms by a healthcare provider. It focuses on the physiological, biological, and genetic causes of the disease.

  • Sociocultural model that aims to modify the physical and social environment of a person with SUD [5].

Many patients, receiving SUD treatments, may have also problems in other areas of their life, including but not limited to: physical and mental health issues, relationship problems, inadequate social and work skills, as well as legal or financial challenges. As a result, the treatment options should aim to address the entire spectrum of issues, and not only treat the addiction component [5].

Even with the variety of treatment options for SUD, more than 6,000 people a month died from overdosing before the pandemic started in the US [6]. In addition to the continued loss of lives due to addiction, the pandemic also added other challenges for those suffering from SUD, resulting in additional 2,000 individuals a month dying from SUD between March and August 2020 [6]. The government COVID-19 based restrictions, like home confinement, caused enormous economic burden to communities in the US as well as around the world. Individuals and their families faced various unwelcome emotional, psychological, and behavioral challenges, including excessive substance abuse and depression [4], which further increased the risk for addiction. The COVID-19 related restrictions caused individuals to turn to smoking, alcohol, drugs, including opioids and synthetic drugs like Fentanyl, as well as gaming activities to deal with the COVID-19 pandemic [6, 7, 8].

On the other hand, individuals suffering from addiction were often also part of low income communities that already faced many significant challenges related to access to healthcare, quality education, and unemployment. They also were also more prone to contract infection during the COVID-19 pandemic due to their underlying comorbid conditions and immune system deficiencies [8, 9].

In this book chapter, the bi-directional correlation between the COVID-19 diagnoses and SUD was investigated, and insights were provided to better understand the impact of the pandemic on addiction occurrence. The research leveraged multiple analytics methods from descriptive statistics, through a simple linear regression, and selected machine learning models to analyze this relationship. The data sources utilized for the analysis included healthcare claims dataset and the state level alcohol consumption.


2. Literature review

The COVID-19 pandemic caused limited social interactions for individuals around the world due to the strict national, state, and local governmental restrictions [10, 11]. As a result of the restrictions, many individuals started using tobacco, alcohol, and other substances to help with stress related symptoms. On the other hand, the increased restrictions and home confinement reduced the substance exposure, but also resulted in more pronounced cravings and withdrawal effects in current users. Selected articles have cited a substantially increased number of drug – and alcohol – withdrawal cases and hospitalizations, which were potentially putting burden on the already strained health care systems [12, 13].

Opioid addiction and its management was often discussed SUD type in the COVID-19 era. Opioid addicts particularly faced a challenge due to difficulty in accessing healthcare services, imposed restrictions on prescription and over-the-counter drugs, closures of rehabilitation centers, and an increased risk of life-threatening withdrawals [14]. While loosening of restrictions were recommended for home-based self-injections and long-acting formulations of methadone and buprenorphine to mitigate these problems, there was also fear of overdosing and fatalities [15, 16].

Due to the financial burden and an uncertain future as a result of the pandemic, gambling activities also increased to unprecedented levels [17, 18]. Eating disorders and compulsive buying were progressively being reported [19, 20]. COVID-19 pandemic created a vicious cycle of stress, depression, social isolation, anxiety, excess leisure time that led to surge of behavioral addictions, resulting in mood alterations, irritability, anxiety, and stress [19, 20].


3. Data and methodology overview

There were multiple types of data utilized for this research. The first source of the data is represented by the healthcare claims database with the study time period from January 31, 2019 to December 31, 2020. Patient cohorts: study target and control were established, using SUD and COVID-19 ICD 10 diagnosis codes. The diagnoses codes are listed in the appendix. The healthcare claims dataset included diagnosis codes, medical and surgical codes, therapeutics and treatments prescribed at the transactional level. In addition, socioeconomic variables, including age, gender, race, education and incomes levels were leveraged to provide additional insights into the characteristics of patients with SUD during COVID-19 pandemic [21].

The second dataset employed for the study represented the State Level Alcohol Consumption trends for 2019 and 2020. The 2020 data was available, however, only through end of September. For this analysis, alcohol consumption data on per capita, alcohol sales from 19 states (Alaska, Arkansas, Colorado, Connecticut, Delaware, Florida, Illinois, Kansas, Kentucky, Louisiana, Massachusetts, Missouri, North Dakota, Oregon, Tennessee, Texas, Utah, Virginia, and Wisconsin) by type of alcoholic beverage was leveraged. Only information from the states noted above was used due to limited availability of data from other states [22].

A number of analytical methods was employed for the analysis from the rules-based patient qualification criteria, descriptive statistics, linear regression analysis to machine learning algorithms in order to understand the bi-directional relationship between SUD trends and the COVID-19 surge.

3.1 Healthcare claims patient level database

The healthcare claims database is an anonymous longitudinal patient data set that can help researchers, healthcare providers, and pharmaceutical companies in the design of research studies in order to aid comparisons of diagnosis and treatment outcomes that represent individual patient-based experiences and interactions with the US healthcare system [21].

The healthcare claims database leveraged for this study consisted of medical, hospital, and prescription claims across all insurance payment types. As shown in Figure 1, the database covers more than 317 million patients in the US, spans over more than 17 years of medical health history, and includes more than 1.9 million healthcare providers [21]. The data elements used for the study included diagnoses codes for SUD and other comorbid conditions, procedures and treatments, payment types: commercial, Medicaid, Medicare and cash, along with patient sociodemographic characteristics like age, gender, race, education and income levels, as well as geography [21].

Figure 1.

Healthcare claims patient level database description.

3.2 Methodology overview: Linear regression introduction

One of the methods utilized to analyze the relationship between addiction and the COVID-19 pandemic was a linear regression approach. In statistics, linear regression is a linear method to modeling the relationship between a scalar response (dependent variable – y) and one or more explanatory variables (independent variables – x):


When there is only one explanatory variable, the regression is called a simple linear regression. When there are more than one independent variables, the process is called a multiple linear regression [23].

In a linear regression, the relationships are modeled using linear predictor functions, whose model parameters are estimated from the data [24]. Linear regression focuses on the conditional probability distribution of the response given the values of the predictors, which is the domain of multivariate analysis [24].

There are several metrics often leveraged to evaluate the model performance: R-squared and F-statistic. R-squared also called the coefficient of determination is the proportion of the variance in the dependent variable that can be explained by the variation in the independent variable(s). The value of the metric ranges between 0 and 1, and the higher value represents a better performance of the model [24]. An F-test represents a statistical test often used when comparing statistical models employed on the studied datasets to identify the model that best fits the population from which the data sample was drawn [24].

3.3 Machine learning introduction

Machine learning is a subfield of the artificial intelligence area, which includes statistics, mathematics, computer algorithms, etc. focused on building applications that learn and improve their predictive capabilities automatically over time without being specifically programmed to do so. Machine learning models are built upon a statistical framework, since they involve data elements often described, using statistical distributions and assumptions. These algorithms gained in popularity in the recent years due the increased amounts of data availability and significant advancements in the computing power [25].

In this book chapter, selected algorithms were leveraged to analyze the relationship between SUD and COVID-19 diagnoses. The analysis identified factors beyond the pandemic, such as patient characteristics: age, race, education and income levels, comorbid conditions (example: diabetes, hypertension, mental health), concomitant treatments that increased the addiction diagnoses, including patients most likely to struggle with SUD, regions of greater prevalence, and comorbid conditions presented along with SUD and COVID-19 diagnoses.

3.3.1 Supervised learning algorithms

Supervised learning is the process of training or building machine learning algorithms, in which algorithms learn to map from input space (X) to output space (Y) [26].


The major objective is to approximate the mapping function (f) in order to predict (y) outcome when a new data point (x) is added [26]. Supervised learning algorithms are mainly used for classification and prediction problems [27]. The following are examples of supervised algorithms: logistic regression, decision trees (DTs), random forest (RF), extreme gradient boosting (XGBoost), support vector machines (SVMs), naïve bayes, adaptive boosting (AdaBoost), and artificial neural network (ANN) [28].

3.3.2 Unsupervised learning algorithms

Unsupervised learning algorithms, on the other hand, learn the hidden patterns within the input dataset (X) [29]. These models are called unsupervised, because there is no supervision to guide them, and the algorithms learn, discover, and display the patterns in the input data (X) [30]. These algorithms are often employed to uncover the natural clusters, dimension reduction, anomaly detection, etc. Examples of unsupervised algorithms include: k-means clustering, principal component analysis (PCA), factor analysis (FA), singular value decomposition (SVD), apriori algorithm (association rule) [28].

Depending on the study objectives and the available data type, algorithms are tested for performance, data type fit, and are selected accordingly. A random forest and an extreme gradient boosting models were selected to explain the bi-directional relationships of the SUD trends and COVID-19 pandemic surge.

3.3.3 xExtreme gradient boosting

Gradient boosting algorithm is an ensemble of weak prediction models, mostly decision trees [31]. XGBoost starts by creating a first simple tree [32, 33], which than adds other trees, and builds upon the weaker learners. The model learns with each iteration and revises the previous tree until an optimal point is reached [34].

Feature importance is the value mostly generated by tree-based models like decision trees, random forest, XGBoost, etc. [31] and signifies the importance of features in the model in predicting the outcome. It represents how good the feature is at reducing node impurity. It is widely known as ‘gini importance’ or ‘mean decrease impurity,’ and is defined as the total decrease in node impurity averaged over all trees of the ensemble [32]. Importance is mostly calculated as: weight, gain and cover, where ‘weight’ is the number of times a feature is present in a tree, ‘gain’ is the average gain of splits, while ‘cover’ is the average coverage of splits, with ‘coverage’ being defined as the number of samples affected by the split [33].

3.3.4 Random forest

Random forest or random decision forest is an ensemble learning method for classification and regression analysis that constructs an array of decision trees during the training timeframe. The output of the random forest for the classification task is the class selected by the majority of trees, while for the regression task, the output represents the mean or average prediction across individual trees [35, 36].

3.3.5 Chi-square test and p-value

The Chi-square test is one of the most widely used non-parametric tests [37], often utilized to test the independence between observed and expected frequencies of one or more attributes in a contingency table, known as ‘goodness of fit test’ [38].

The p-value, also used in this study, evaluates the statistical significance of the predictor variables. The significance level was set at the 5% and 10% to aid the feature importance evaluation and statistical results’ interpretation [24, 38].

3.3.6 Classification metrics

The following classification metrics were leveraged to validate the machine learning models’ performance. A confusion matrix is often generated from the predicted probability values with 0.5 as the classification threshold. Patients with probability value greater than or equal to 0.5 are noted as 1 and below 0.5 are noted as 0 [38].

Confusion matrix:

  • True Positive (TP) – Target patient correctly identified by the model as target patient

  • False Positive (FP) – Control patient misclassified by the model as target patient

  • True Negative (TN) – Control patient correctly classified by the model as control patient

  • False Negative (FN) – Target patient misclassified by the model as control patient

Model performance metrics:

  • Accuracy: % of total patients correctly identified among total patients

  • Positive Predictive Value (PPV, Precision): % of true target patients among total predicted target patients

  • True Positive Rate (TPR, Sensitivity, Recall, Hit Rate): % of true target patients who were correctly identified among total target patients

  • False Positive Rate (FPR): % of true control patients incorrectly identified among total control patients

  • Specificity: % of those control who will have a negative target result

  • F1 Score: is the harmonic mean of precision and recall

  • AUC: Area Under the Receiver Operating Characteristic (ROC) Curve. To validate the trade-off between true positive rate and false positive rate [38].


4. Analysis results and discussion

4.1 Substance usage disease trends overview

This section provides an overview of SUD trends for 2019 and 2020 when leveraging the healthcare claims dataset that was discussed in the earlier section of the chapter. The summary includes information on the overall trends, patient demographics, and insights into the COVID-19 diagnosis rates. The first part of the analysis was to review and understand the SUD diagnoses trends as well as COVID-19 infection rates within the SUD population. The focus of the analysis was on the SUD population only to understand changes in trends during the pandemic.

The monthly trends of patients with SUD diagnoses presented that the addiction trends stayed consistent over 2019 and 2020, with the exception of April–May 2020 timeframe. The list of SUD diagnoses is presented in the appendix refers to Tables 69. At the beginning of the pandemic (April–May 2020), there was a decrease in the number of patients with addiction diagnoses. A two sample t-test that compared the SUD diagnosis counts between April–May 2019 and April–May 2020 revealed that the difference in counts was not significant at either the 5% or 10% significance level. However, the directional decline might have been a result of the state enacted restrictions, including home confinement as well as the inability to hold in-person HCP office visits and elective procedures (Figure 2).

Figure 2.

Addiction monthly patient count trends, 2019–2020.

The SUD diagnoses trend data also involved analyzing trends by splitting the patient cohort into newly diagnosed patients in the last 12 months as well as previously diagnosed patients within the same timeframe. The analysis presented that the share of newly diagnosed patients vs. previously diagnosed declined slightly between 2019 and 2020, but the difference was not statistically significant. In 2020, newly diagnosed patients accounted for 62% of all patients vs. 66% in 2019. In addition, patients diagnosed with addiction as well as COVID-19 represented 3% of the newly diagnosed patients and 4% of those with already a diagnosis.

Furthermore, several different types of SUD experienced a decline in the number of patients diagnosed at the start of the pandemic. Opioid dependence was the leading addiction type with alcohol dependence following as next most frequently diagnosed SUD (Figure 3). The counts of opioid dependence diagnosis were statistically different from the counts for other types of SUD. Statistically significant difference in trends at 5% significance level was also observed between opioid dependence and alcohol dependence, opioid dependence vs. cannabis dependence, sedatives dependance vs. cannabis dependance, and sedatives dependence vs. alcohol use. The addiction diagnosis codes are noted in the appendix. Patients with psychoactive type of addiction represented a higher share within the COVID-19 diagnosed population (19%) as compared to the overall share (3%). Psychoactive SUD is referred to as addiction type with hallucinatory symptoms. The COVID-19 patient distribution for other addictions was very similar to the overall addiction population.

Figure 3.

Addiction monthly patient count trends, 2019–2020.

An additional analysis of demographic and geographic attributes as presented in Table 1 revealed that males presented a higher percentage of the SUD population compared to SUD and COVID-19 population, but the percentage was not statistically significantly different from the percentage of women SUD patients. On the other hand, patients using cannabis appeared younger compared to the rest of the SUD population. This finding was statistically significant based on a two sample t-test (p-value = 0.00, statistically significant at 5%).

Table 1.

Patient demographic summary (age and gender).

Most of both SUD and COVID-19 patients had commercially provided insurance coverage (∼70%), while ∼30% of patients had a government provided healthcare insurance (p-value = 0.00, statistically significant at 5%). Inhalants and rehabilitation drug addiction represented the highest share of patients with commercial insurance with more than 75%.

Furthermore, the North East and Midwest regions represented two main geographic areas of the United States with the highest level of patients diagnosed with SUD and covered more than 50% of the total addiction diagnosed patients. The share of patients in these two regions was statistically significantly higher compared to the rest of the US regions (p-value = 0.00, statistically significant at 5%). The West regions on the other hand covered approximately 20% of the addiction diagnosed population.

The SUD treatment pattern analysis revealed that the procedural services, including psychotherapy, recommended to treat SUD patients declined in April and May 2020 and then returned to similar levels before the pandemic and on par with the 2019 trends (Figure 4). The decline was statistically significant at the 10% significance level with a p-value = 0.07. The decline might have been related to the imposed country-wide lockdown during the two months on 2020.

Figure 4.

Procedural treatment trends, 2019–2020.

On the other hand, the number of patients treated with prescription medications statistically significantly increased between 2019 and 2020 (p-value = 0.00, statistically significant at 5%), even during the pandemic, the trend continued to increase, implying that patients continuously were receiving patient care (Figure 5). The drugs names are presented in the appendix. Prescription treatments for drug related addiction had the highest share of the treatments, followed by addiction relapse treatments. The share of drug prescription treatments was statistically different from the other types of therapy, including relapse and alcohol treatments.

Figure 5.

Addiction Rx treatment monthly patient count trends, 2019–2020, by addiction type.

4.2 Alcohol consumption overview

This section of the book chapter provides an overview of alcohol consumption trends for 2019 and 2020. For this analysis, alcohol consumption data on per capita, alcohol sales from 19 states (Alaska, Arkansas, Colorado, Connecticut, Delaware, Florida, Illinois, Kansas, Kentucky, Louisiana, Massachusetts, Missouri, North Dakota, Oregon, Tennessee, Texas, Utah, Virginia, and Wisconsin) by type of alcoholic beverage was leveraged. The limited alcohol consumption information by state was due to the limited data availability at source [22].

The monthly trends of pure alcohol (gallons of ethanol) from 2019 and 2020 in Figure 6 showed that the trend stayed nearly the same, with a only a directional increase in 2020 [22]. A two sample t-test did not present statistically significant differences between the yearly trends. On the other hand, it was observed that with the increase in COVID-19 cases in the middle of pandemic (June–August 2020), there was an associated increase in the consumption of pure alcohol, as evident from the high Pearson correlation coefficient of 0.87 between the alcohol consumption and COVID-19 diagnosed number of patients. The increase in the alcohol use might have been associated with individuals experiencing hardship due to the prolonged lockdowns, loss of job, and the overall changes in lifestyle as a result of pandemic, and alcohol being perceived as a way for coping with the changing environment.

Figure 6.

Monthly avg. of pure alcohol (gallons of ethanol) across United States.

The trends describing gallons of alcohol per capita for age 14 and older (Figure 7) showed a statistically significance increase (p-value = 0.04, statistically significant at 5%) in gallons per capita from mid-May 2020, which might be a result of the COVID-19 pandemic spread. This was also apparent from a strong a Pearson correlation coefficient of 0.91 between the pandemic outbreak as denoted by a volume of patients diagnosed with COVID-19 and gallons of alcohol per capita [22].

Figure 7.

Gallons of ethanol per capita age 14 and older (2019 and 2020).

In order to understand the alcohol consumption over time, the percentage change in gallons of alcohol per capita from 2017 to 2019 (a 3-year average) to 2020 was analyzed (Figure 8). Overall, a visible increase in the trend was noticed; however, in May 2020, a statistically significant decline in the percentage in alcohol consumption (p-value = 0.06, statistically significant at 10%) was observed due to the COVID-19 imposed lockdowns and closures of liquor stores. From the month of June onwards, a statistically significant increase in the percentage change (p-value = 0.06, statistically significant at 10%) was noted, which might have been associated with the lockdown restrictions being partially lifted, leading to re-opening of liquor stores and increased purchasing levels [22].

Figure 8.

Percentage change in gallons of ethanol per capita age 14 and older from 2017 to 2019 (3-year average) to 2020. Note: Limited states shown due to unavailability of the data from the source.

Figure 9 depicts a comparison of selected states’ gallons of alcohol consumption per capita between 2019 and 2020. As noted earlier, only a few selected states were considered for the analysis due to the limited availability of the data at the source. For most of the states, an increase in alcohol (in gallons) per capita is noticeable in 2020. Delaware’s excise tax on liquor of $3.75 per gallon, lower than 72% of the other 50 states, led to the highest increase in per capita alcohol in 2020. Most of the states experienced an increase in per capita alcohol during the COVID-19 pandemic [22].

Figure 9.

State wise three-year average gallons of ethanol per capita age 14 and older, 2017–2019 and 2020.

The alcohol consumption data was also analyzed for each alcohol type. Figure 10 presents a yearly consumption comparison between 2019 and 2020 for beer, wine and spirits. It was observed that beer consumption was higher in January and February in 2020 compared to January and February in 2019, but after the COVID-19 pandemic started, the consumption decreased from March onwards until May 2020 due to lockdowns and limited liquor facilities opened in each state. For wine and spirits, the trend of consumption showed an increase, starting from January 2020 onwards [21]. It was also evident that the increase in volume of beer, spirit, and wine consumption from 2019 to 2020 was statistically significant based on the two sample t-test, which resulted in a p-value < 0.02 for each alcohol type [22].

Figure 10.

Average beverage consumption breakout by wine, beer and spirit from 2019 and 2020. Note: 2020 data is available only until Sep due to limited availability from the source.

4.3 Effects of alcohol and substance use during COVID-19

In this section of the book chapter, the effects of alcohol and SUD during the COVID-19 pandemic were analyzed. An ordinary least square linear regression model was used to investigate the correlation between these events. The dataset employed was a combination of the healthcare claims data and the alcohol consumption data, both aggregated at a state and monthly levels for comparison [21, 22].

The results of the ordinary least square regression are presented in Table 2. The analysis results showed that sedatives use, alcohol abuse, and beer consumption were the highly significant variables and positively correlated with the COVID-19 pandemic spread. Sedatives like benzodiazepines are often prescribed for anxiety and insomnia, confirming the finding [39]. Furthermore, an increased consumption of alcohol might have led to seeking treatments to manage the signs of frustration, sadness, mental health conditions, and stress [40], caused by the prolonged isolation during the pandemic.

Table 2.

Ordinary least square regression analysis results.

Note: Per capita alcohol sales from 19 states (Alaska, Arkansas, Colorado, Connecticut, Delaware, Florida, Illinois, Kansas, Kentucky, Louisiana, Massachusetts, Missouri, North Dakota, Oregon, Tennessee, Texas, Utah, Virginia, and Wisconsin) by type of alcoholic beverage.

Other parameters like opioid use, cannabis use/abuse were significant as well, but they were negatively correlated with the pandemic spread. These results were consistent with previous research articles, presenting that drug use declined during the pandemic while at the same time patients suffered from withdraws and other symptoms related to fewer substances available for consumption [12, 13, 14, 41, 42]. On the other hand, while beer consumption was positively correlated with COVID-19 pandemic trends, the consumption of spirits presented the reversed correlation, which was contrary to the findings of overall alcohol trend increases. The difference in correlation might have been related to the differences in states regulations of the different types of alcohol, which in turn might impact the alcohol type availability for consumption at the state level [43].

The model significance was evident from the F-statistic value of 14.7 with an adjusted R square value of ∼74%, which informed that a relatively high proportion of the variations in the data could be explained by the predictor variables.

4.4 Machine learning: important features leading to addiction

To understand the parameters associated with SUD and identify if the COVID-19 pandemic impacted the addiction diagnosis rate, supervised classification machine learning algorithms, including random forest and XGBoost were performed.

4.4.1 Dataset overview

As a part of the analysis, two distinct patient cohorts: study target and control groups were developed to allow for analysis of the SUD and COVID-19 trends. The distinction between these two groups permitted the machine learning models to learn the variations in the data and identify the important variables that best distinguished between both groups. The target group was defined by the patients in the data from October 2020 to December 2020, who had at least 2 addiction diagnoses, followed by a treatment after initial diagnosis, and the control group was defined by the patients from October 2019 to December 2019, having two addiction diagnoses, followed by a treatment after initial diagnosis. A sample of ∼20,000 records were randomly selected for the modeling exercise based on similar age and gender distribution as in the target group. Two months of historical claims data related to diagnosis, procedures, and pharmacological treatment were pulled from initial diagnosis event along with other demographic data elements like age, gender, income, education, etc. The healthcare claims level data was converted to patient level records, using data pre-processing steps, and a final data structure with ∼ 20,000 records and ∼15,000 features was created for machine learning modeling [21].

4.4.2 Feature selection

The data elements used for the study included diagnosis, procedures, and pharmacological treatments along with other demographic features like age, gender, income, education, etc. Since the number of features was ∼15,000, the data element dimension needed to be reduced to a more manageable number.

In order to reduce the variables’ space and select the top features, the LightGBM and Boruta algorithms were leveraged for the purposes of dimension reduction. LightGBM is a gradient boosting framework, which uses tree-based learning, whereas Boruta is a feature selection algorithm, a wrapper built around RF Classification algorithm. The top features from both the algorithms were selected for the machine learning algorithms development [44].

Table 3 below represents a list of selected features important in the preliminary run of the models. Data elements related to the COVID-19 diagnoses and associated symptoms along with alcohol and nicotine use as well as major depressive disorder were noted as important variables, separating the 2020 and 2019 SUD patient cohorts.

Table 3.

Preliminary important data features.

4.4.3 Machine learning models overview

In order to understand the underlying factors for the SUD 2020 and 2019 patient cohorts and investigate if there was an association with the COVID-19 pandemic, the following machine learning models were applied: random forest and XGBoost. Hyper tunning process was also performed to optimize the models. Below a brief methodology overview is presented.

Random forest is a classification algorithm, consisting of many decision trees that use bootstrap aggregation, bagging and feature randomness when building each individual tree. It creates an uncorrelated forest of trees whose prediction is more accurate than that of any individual tree. The model outcome provides estimates of variables important in the classification [45].

XGBoost is a decision-tree-based ensemble machine learning algorithm that uses a gradient boosting framework. XGBoost approaches the process of sequential tree building, using parallelized implementation. Each model run learns from the error of previous models and weak learners. It incorporates the error of weak learners in the ensemble model and re-runs the process. It uses bootstrap aggregating technique, also called as bagging, which implies diving the data into sub samples for each iteration of model training. For prediction purposes, the model chooses majority of the vote from all the learners [46].

Hyper parameter tuning is the optimization process of finding the model parameters to improve the model performance. The objective is to minimize the cost function, hence reduce the error caused by the model. It uses gradient descent algorithm, which initially randomly assigns the model parameter to calculate the cost function and later improves it at each step, so that the cost function assumes a minimum value. Mathematically, it takes the derivative of the sum of squared residuals and equates it to 0 to find a point where the function is changing [47].

4.4.4 Machine learning analysis details

The machine learning algorithms were evaluated for the different performance metrics as noted in the earlier section of the book chapter. Initially, the models were overfitting, as they seemed to capture most of the variations from the training data, as well as at the same time captured the noise from the data. This resulted in many negative records misclassified as positive, which might have led to a considerably lower precision value.

As noted in Table 4, the baseline models, random forest resulted in AUC of 73% and XGBoost resulted in AUC of 74% with recall of 74.08% and 82.80% respectively. While working with healthcare claims data, a higher ratio of false negative records is perceived as a large problem. For example, predicting a sick patient as healthy, because ideally the patient should have received the treatment on time, may lead to health complications and even potentially death. Thus, it is advised to minimize the number of false negative observations, which will result in a higher recall, depicting an inverse relationship between the two, also called true positive rate or sensitivity. However, the initial baseline models resulted in a comparatively lower recall. To improve the model accuracy, the hyper parameter tuning was executed to find the best model parameters.

Table 4.

Machine learning model metrics.

In addition, F1 score was defined as follows:


which is a function of precision and recall and should be maximized such that both precision and recall both are optimal [45, 46, 47]. Hyper parameter tuned models not only improved the recall, but also slightly improved the F1 scores for random forest and XGBoost to 69.4% and 69.57% respectively, implying a robust model sensitive to false negative observations.

The machine learning models were retrained, using a few model parameters, including mex=depth, min-samples_split and max_features. In order to obtain the optimal values of model parameters, k fold cross validation with 5 iterations were used in the hyper parameter tuning process [47].

Using the optimal values of the model parameters obtained from hyper parameter tuning, the models showed an improvement in the model performance, which was evident from the model metrics. As shown in Table 4, the recall significantly increased for both of the models and also, the F1 scores slightly improved compared to the baseline models. This resulted in a decrease in the false negatives count, which led to an increase in recall.

Figure 11 depicts the final ROC AUC plot, which shows the relationship between the true positive rate and the false positive rate at different probability thresholds. A true positive rate also known as the sensitivity metric, which informs the proportion of positive records that were correctly classified over the total number of positive records. A false positive rate is the proportion of negative records misclassified over total number of negative records [38]. Both random forest and XGBoost resulted in AUC of 75% with recall of 94.7% and 85.6% respectively, which improved from the baseline models.

Figure 11.

ROC AUC curve of random forest and XGBoost.

4.4.5 Machine learning model interpretation

The random forest and XGBoost models identify features, which were a combination of SUD as well as COVID-19 data elements. Table 5 presents the top important features. The importance of the features was measured using the ‘gini’ importance metric, which calculated the impurity in the node. The metric measured how each feature decreased the impurity of the split, while making the decision tree in the algorithm and averaging it over all the trees in the forest, resulting in the measure of feature importance [32, 33].

Table 5.

Top most important healthcare related features.

Features like nicotine dependence, alcohol abuse, long term drug therapy, disulfiram [48], methadone [49] were presented as important in explaining the differences in SUD patient cohorts between 2019 and 2020. For example, the value 0.003 of nicotine dependence importance denoted that the impurity reduced in the node by adding the variable, which thus contributed to the model robustness and a higher accuracy level. The effects of pandemic on individual’s lives were not only restricted to patients’ physical health, but also affected their mental health, as noted by the major depressive, anxiety diagnoses, and suicidal tendencies as presented in the top most important healthcare data elements. The unexpected and unwanted change enforced on daily lives, drastically increased the stress levels. Difficulties in management of the changing environment and following preventive measures, such as undergoing lockdowns, fueled the stress levels even more. The economic downturn, leading to unemployment, and low consumer confidence played an imperative role in increasing the stress levels as well. As a result of the prolonged stress and anxiety due to the lockdowns, the consumption of alcohol, smoking, and other nicotine-based products increased [12, 13, 41, 42].

It was also interesting to see features related to COVID-19 pandemic being noted as important differentiators between the 2019 and 2020 SUD patient cohorts. The features included COVID-19 diagnosis and related symptoms: headache, cough, acute upper respiratory infection, specimen collection for severe acute respiratory condition. Procedures noting HCP in-office and tele-visits along with in-patient hospital or ER visits were also noted as important variables, further highlighting that the amount of care might have increased as a result of SUD, but also due to COVID-19 diagnoses and related symptoms. In addition, medications often used to treat viruses and infections like Azithromycin were also presented as important data elements defining the 2020 SUD patient cohort.

Furthermore, the cohorts differed on the occurrence of the comorbid conditions, such as chronic kidney condition, hypertension, hyper lipidemia, and gastro-esophagus conditions, which might inform a potential impact of a larger alcohol and other substance abuse activities during the pandemic or simply present that the patient profile changed during the pandemic, expanding the definition of the SUD patients group. There were also several data elements identifying SUD treatments such as Narcan, methadone to list a few and procedures related to drug testing, blood panels, and other related treatments, which present an increased rate of addiction testing and treatment between the two periods, confirming earlier findings of increased SUD treatment trends. The analysis also presented differences of the cohorts on a diagnoses for lower back pain and pain relieve medications use.

From the sociodemographic data elements, patients diagnosed with addiction or treated for addiction presented characteristics that can help further define the patient profiles for individuals that were likely for developing SUD during the pandemic. For example, the average age of 42 was observed for the impacted population. Ethnicity of Caucasian and Black/African American was also noted as prevalent. Patients with nicotine dependence, alcohol dependence, opioid use, and cannabis dependence were relatively more prevalent in the states of Florida and Texas. These states presented a relatively higher volume of patients with specific SUD diagnoses compared to other states. The impacted patients presented some college or achieved at least a high school diploma as well as were more likely to be associated with the lower economic status communities, with income level being less than $30 K annually. The educational and economic levels were noted by other published articles, presenting the economic impact and increased risk for COVID-19 virus within low income population [2].


5. Conclusions and study limitations

This book chapter investigated SUD and the resulting impact from the COVID-19 pandemic on the rate of diagnoses and treatment. Overall, the diagnoses rate of SUD was consistent over time in 2020 compared to 2019 (except for April and May); however, a statistically significant increase in treatment of different addiction types was noted during the pandemic. In 2020, newly diagnosed patients accounted for 62% of all SUD patients compared to 66% in 2019, but the difference was not statistically significant. Furthermore, the changes in procedures performed for addiction testing significantly declined at the beginning of the pandemic and then returned to normal levels in June of 2020, while the SUD treatment significantly increased between 2019 and 2020. In addition, patients diagnosed with addiction as well as COVID-19 represented 3% of the newly diagnosed patients and 4% of those with already a diagnosis. Patients using cannabis were found statistically significantly younger compared to the rest of the SUD population.

In 2020, a noticeable increase in alcohol consumption and drinking behaviors was observed compared to 2019, including an increase in the average gallons consumed by alcohol type: spirits, wine, and beer. Compared to the previous years, a statistically significant positive percentage change in gallons of alcohol per capita from 2017 to 2019 (a 3-year average) to 2020 was observed [22], which could be related to the increased stress levels due to the pandemic spread and prolonged lockdowns [50].

Machine learning analysis of SUD patient cohorts between 2020 and 2019 presented that the patients in the 2020 cohort who were diagnosed with SUD, were also often diagnosed with either COVID-19 or related symptoms, including headache, upper respiratory infection, and cough. Furthermore, it is likely that SUD patients with addiction to drugs and nicotine products were more likely to contract COVID-19, as a result of their weaker immune system due to lower white cells levels in the blood [51, 52]. The analysis also presented the importance of HCP in-office and tele-visits along with in-patient hospital visits that could be related to the increased level of SUD treatment, but also present the severity of COVID-19 related symptoms and the need for treatment.

Moreover, excess alcohol consumption identified as one of the important factors, differentiating between the two SUD patient cohorts could lead to immune deficiency, causing increased susceptibility to certain diseases. Prolonged alcohol abuse may cause disruptions to the digestive system and could result in liver failure. Alcohol use may also affect individual’s ability to store adequate amounts of protein and nutrients. Most importantly drugs and alcohol affect white blood cells, which act as the defense system for the body. The weaker defense system can increase the risk of developing life-ending diseases [52].

Finally, based on the machine learning analysis, the SUD patient cohorts differed on occurrence of the comorbid conditions such as chronic kidney condition, hypertension, hyper lipidemia, and gastro-esophagus condition, which might present that the SUD patient profile changed during the pandemic due to the changes in the life style and increased consumption of alcohol and tobacco. Additional investigation should be conducted to further examine the patients’ health history and understand the underlying reasons for the differences in the SUD patient cohort characteristics.

5.1 Study limitations

Due to the timing of writing this book chapter, not all data was available for the entire year of 2020 to allow for a comprehensive analysis. Adding the additional data for alcohol consumption, as well as data for recreational drug use by state during the pandemic could enhance the analysis in presenting the SUD population characteristics including their health, mental, and economic state. Furthermore, it might also be helpful to add COVID-19 vaccination data by state in order to understand the effects of vaccinations and COVID-19 variants on general virus trends as well as SUD impacted populations.

Additionally, the healthcare patient level claims data, comprising of prescription, medical, and hospital claims can also observe gaps in the coverage of long-term care institutions, mental health hospitals, correctional facilities, and other institutions with a limited public reporting, and result in a potential bias in the studied population when compared to the entire US population. Furthermore, the COVID-19 related symptoms’ diagnoses might also skew the analysis and overestimate the impact of COVID-19 on the SUD population. The statistical results could be further enhanced and become more robust with the additional data availability and understanding of the diagnosis codes for the COVID-19 related symptoms.

Since the COVID-19 pandemic was a rare event, it became a new topic of interest for analysis. As a result, there was a limited number prior research studies conducted on this topic, which posed a challenge in creating a theoretical foundation for this book chapter’s research questions and hypothesis. With little prior research, developing an entire new research typology was challenging.

The scope of the analysis can also be enhanced via adding additional data sources and having a longer timeframe to evaluate the impact of pandemic on addiction and health impact of those impacted by either condition. Furthermore, new set of advanced analytics, including deep learning and natural language processing (NLP) approaches, could be applied to create data driven evidence to confirm newly established hypothesis, research objectives, and results.



Availability of data and materials: The healthcare claims dataset that supports the findings of this study are available from Symphony Health, ICON plc Organization, but restrictions apply to the availability of these data, which were used under a license for the current study, and so they are not publicly available.

The Alcohol Consumption Dataset is available from the National institute of Alcohol Abuse and Alcoholism [Online].


Conflict of interest

The authors declare no conflict of interest.


(Tables 69).

Table 6.

Substance abuse disorder diagnosis codes.

Table 7.

Substance abuse disorder procedure codes.

Table 8.

Substance abuse disorder treatment codes.

Table 9.

COVID-19 diagnoses codes.



Authors work for Symphony Health, ICON plc Organization. The data used in the article is the property of Symphony Health, ICON plc Organization. Authors used the healthcare claims data for the sole purpose of publication of this article.


Notes/Thanks/Other declarations

The authors would like to thank Mike Byzon, Suzanne Rosado, Heather Valera, Lakshya Mandawat, and Koichi Iwata for their valuable feedback on earlier versions of this chapter.


  1. 1. SAMHSA. Leveraging Existing Health and Disease Management Programs to Provide Mental Health and Substance Use Disorder Resources During the COVID-19 Public Health Emergency (PHE). June 2020. [Online] Accessed on July 22, 2021.
  2. 2. GBD 2016 Alcohol and drug use collaborators the global burden of disease attributable to alcohol and drug use in 195 countries and territories, 1990-2016: A systematic analysis for the global burden of disease study 2016. Lancet Psychiatr. 2018;5:987–1012.
  3. 3. SAMHSA. 2007. Results from the 2006 National Survey on Drug Use and Health: National Findings. (DHHS Publication no. SMA 07–4293, NSDUH series H-32) Office of Applied Studies: Rockville, MD.
  4. 4. Feltenstein, M.W. and See, R.E. The neurocircuitry of addiction: an overview. British Journal of Pharmacology. 2008 154: 261-274. [Online] DOI: 10.1038/bjp.2008.5. Accessed on July 15, 2021.
  5. 5. Pedersen T. How Substance Use Disorders (SUD) are Treated? Psych Central. May 2021. [Online] Accessed on July 15, 2021.
  6. 6. Baumgartner, J. C. and Radley, D. C. The Spike in Drug Overdose Deaths During the COVID-19 Pandemic and Policy Options to Move Forward. March 2021. [Online] Accessed on July 15, 2021.
  7. 7. Dubey S., Biswas P., Ghosh R., Chatterjee S., Dubey M.J., Chatterjee S. Psychosocial impact of COVID-19. Diabetes Metab Syndrome. 2020 DOI: 10.1016/j.dsx.2020.05.035.
  8. 8. Ornell F., Moura H.F., Scherer J.N., Pechansky F., Kessler F., von Diemen L. The COVID-19 pandemic and its impact on substance use: Implications for prevention and treatment. Psychiatr Res. 2020;289:113096.
  9. 9. Columb D., Hussain R., O’Gara C. Addiction Psychiatry and COVID-19 – Impact on patients and service provision. Ir J Psychol Med. 2020 May 21:1–15. DOI: 10.1017/ipm.2020.47.
  10. 10. Hefler M., Gartner C.E. The tobacco industry in the time of COVID-19: Time to shut it down? Tobac Contr. 2020;29:245–246.
  11. 11. The Times of India. 2020. How to use lockdown as an opportunity to overcome alcohol addiction. [Online] Accessed on February 1, 2021.
  12. 12. News18. 2020. Amid coronavirus lockdown, states across India witness surge in suicide cases due to alcohol withdrawal symptoms. [Online] Accessed on February 1, 2021.
  13. 13. Rani S., Sahoo S., Parveen S., Mehra A., Subodh B.N., Grover S. Alcohol-related self-harm due to COVID-19 pandemic: Might be an emerging crisis in the near future: A case report. Indian J Psychiatr. 2020;62:333–335.
  14. 14. Sun Y., Bao Y., Kosten T., Strang J., Shi J., Lu L. Editorial: Challenges to opioid use disorders during COVID-19. Am J Addict. 2020;29:174–175.
  15. 15. Becker W.C., Fiellin D.A. When epidemics collide: Coronavirus disease 2019 (COVID-19) and the opioid crisis. Ann Intern Med. 2020 Apr 2:M20–M1210. DOI: 10.7326/M20-1210.
  16. 16. Vecchio S., Ramella R., Drago A., Carraro D., Littlewood R., Somaini L. COVID19 pandemic and people with opioid use disorder: Innovation to reduce risk. Psychiatr Res. 2020;289:113047.
  17. 17. Håkansson A., Fernández-Aranda F., Menchón J.M., Potenza M.N., Jiménez-Murcia S. Gambling during the COVID-19 crisis – A cause for concern? J Addiction Med. 2020 May 18 DOI: 10.1097/ADM.0000000000000690.
  18. 18. Schalkwyk M.C., Cheetham D., Reeves A., Petticrew M. Covid-19: we must take urgent action to avoid an increase in problem gambling and gambling related harms. BMJ Opinion. 2020. [Online] Accessed on February 1, 2021.
  19. 19. Touyz S., Lacey H., Hay P. Eating disorders in the time of COVID-19. Version 2. J Eat Disord. 2020;8:19.
  20. 20. Watanabe M. 2020. Beyond retail therapy the case against pandemic shopping. [Online] Accessed on February 1, 2021.
  21. 21. Integrated Dataverse (IDV®). [Online] Accessed on October 1, 2020.
  22. 22. National institute of Alcohol Abuse and Alcoholism. [Online] Accessed on March 1, 2021.
  23. 23. David A. Freedman (2009). Statistical models: Theory and practice. Cambridge university press. p. 26. “a simple regression equation has on the right hand side an intercept and an explanatory variable with a slope coefficient. A multiple regression e right hand side, Each with its Own Slope Coefficient.”
  24. 24. Hilary L. Seal (1967). “The historical development of the gauss linear model”. Biometrika. 54 (1/2): 1–24. DOI: 10.1093/biomet/54.1-2.1. JSTOR 2333849.
  25. 25. Sarker, I.H. Machine Learning: Algorithms, real-world applications and research directions. SN COMPUT. SCI. 2, 160. 2021. [online] DOI: 10.1007/s42979-021-00592-x. Accessed on July 15, 2021.
  26. 26. Hastie, T., Tibshirani, R., And Friedman, J. Overview of Supervised Learning. The Elements of Statistical Learning. Springer. (2009). Pp. 9–39. Alpaydın, E. (2014).
  27. 27. Introduction to machine learning. Cambridge, MA: MIT Press. Hosmer, D. W., Lemeshow, S. Applied Logistic Regression. New York: Wiley. (2013). ISBN 978-0-470-58247-3.
  28. 28. Ballantyne Draelos, R.L. Best Use of Train/Val/Test Splits, with Tips for Medical Data. Glass Box Machine Learning and Medicine. [Online] Accessed on October 5, 2020.
  29. 29. Simeone, O. A very brief introduction to machine learning with applications to communication systems. arXiv preprint arXiv:1808.02342v4. (2018).
  30. 30. Hinton, G., Sejnowski, T. Unsupervised Learning: Foundations of Neural Computation. MIT Press. (1999). ISBN 978-0262581684.
  31. 31. Friedman, J.H. Greedy function approximation: A gradient boosting machine. The Annals of Statistics 29: 1189-1232. (2001). [Online] DOI: 10.1214/aos/1013203451. Accessed on October 1, 2020.
  32. 32. Extreme Gradient Boosting. [Online] Accessed October 1, 2020.
  33. 33. Hastie, T., Tibshirani, R., Friedman, J. H. ‘10. Boosting and Additive Trees’. The Elements of Statistical Learning (2nd ed.). New York: Springer. (2009). pp. 337–384.
  34. 34. Cochran, W.G. The chi-square test of goodness of fit. The Annals of Mathematical Statistics 23(3): 315–345. (1952).
  35. 35. Ho, Tin Kam (1995). Random Decision Forests (PDF). Proceedings of the 3rd International Conference on Document Analysis and Recognition, Montreal, QC, 14–16 August 1995. pp. 278–282. Archived from the original (PDF) on 17 April 2016. Retrieved 5 June 2016.
  36. 36. Ho TK (1998). “The random subspace method for constructing decision forests” (PDF). IEEE Transactions on Pattern Analysis and Machine Intelligence. 20 (8): 832–844. DOI: 10.1109/34.709601.
  37. 37. On the interpretation of χ2 from contingency tables, and the calculation of p. Journal of the Royal Statistical Society 85(1): 87-94. (1922). [Online] DOI: 10.2307/2340521. Accessed on July 15, 2021.
  38. 38. Manning, C.D., Raghavan, P., and Schütze, H. Introduction to Information Retrieval. Feature Selection, Chi-Square Feature Selection Cambridge University Press. (2008).
  39. 39. Prescription Sedative Misuse and Abuse. [Online] Accessed on March 1, 2021.
  40. 40. Centers for Disease Control and Prevention; Coping with stress. [Online] Accessed on March 1, 2021.
  41. 41. Narasimha V.L., Shukla L., Mukherjee D., Menon J., Huddar S., Panda U.K. Complicated alcohol withdrawal-an unintended consequence of COVID-19 lockdown. Alcohol Alcohol. 2020 May 13 agaa042.
  42. 42. Varma R.P. Alcohol withdrawal management during the Covid-19 lockdown in Kerala. Indian J Med Ethics. 2020; V:105–106.
  43. 43. List of alcohol laws of the United States. [Online]
  44. 44. Bhattacharyya, I. Feature Selection (Boruta/Light GBM/Chi Square)-Categorical Feature Selection. [Online] Accessed on March 1, 2021.
  45. 45. Random Forest Algorithm. [Online]∼breiman/RandomForests/cc_home.htm;; Accessed on March 1, 2021.
  46. 46. XGBoost Algorithm. [Online] Accessed on March 1, 2021.
  47. 47. Hyper Tunning [Online], Accessed on March 1, 2021.
  48. 48. MedlinePlus. [Online] Accessed on March 1, 2021.
  49. 49. HCPCS. Codes Accessed on March 1, 2021.
  50. 50. Alcohol Consumption during the COVID-19 Pandemic: A Cross-Sectional Survey of US Adults. [Online] Accessed on March 1, 2021.
  51. 51. Effect of alcohol on immune system [Online] Accessed on March 1, 2021.
  52. 52. COVID-19 and People who Use Drugs [Online] Accessed on March 1, 2021.

Written By

Ewa J. Kleczyk, Jill Bana and Rishabh Arora

Submitted: 22 January 2021 Reviewed: 24 July 2021 Published: 21 September 2021