Analyzing the Opioid Epidemic in Connecticut: 2014-2016

Katie Critelli
Posted on Jul 23, 2017


At the end of 2016, a Stat News article declared that over 59,000 Americans had died of drug overdoses, the most ever recorded in the course of a year. The article highlighted the growing national abuse of heroin and prescription painkillers. In light of this national crisis, this project focuses a spotlight on the state of Connecticut. Using opioid use datasets from 2014-2016, demographic, educational, and geographic factors are examined to answer the following questions:

1) Which populations have been hardest hit by the opioid crisis?

2) How can the government intervene most effectively to prevent deaths?

The overall project can be found here as a Shiny app:
Relevant code for the project can be found here:

Background Information Sources


In order to assess distribution and use of opioids in the state of Connecticut, datasets were taken from multiple sources:


Datasets from Kaggle provided information on counts of opioid-related overdoses by US state as well as a breakdown of the opioid prescriptions written across various medical specialties. Further details within the "Opioid Prescriber" dataset could yield interesting insights into which medical specialties are prescribing opioids in cases in which a different drug could be substituted. Datasets from provided detailed information on accidental drug-related deaths in the state of Connecticut from 2012-2016, which was filtered down to the years 2014 and 2016 for the purpose of this analysis. The dataset "Opioid-related treatment admissions by town in the department of mental health and addiction" was also used to compare locations of opioid-related death to locations of active opioid addiction treatment centres.

Why Connecticut?

-Connecticut has been hit hard by the national opioid crisis, which appears to be growing and gaining local and national concern

-Connecticut is a state of extremes. It has one of the largest educational achievement gaps in the country, according to the Department of Education, and it boasts the largest income gap, according to the Economic Analysis and Research Network

-Connecticut offers an interesting model for study: Opioid use and prescription data is readily available, different demographic and social extremes are open to analysis, and the question of how to quell the medical crisis remains unresolved

Methodology and Analysis

which populations have been hardest hit by the opioid crisis?

In order to answer the first question, the dataset from reporting opioid-related deaths from 2012-2016 was filtered and analysed. The analysis focused on data from the year 2014, in order to match it with the data on opioid prescriptions and to isolate a period in time.

The final Shiny app contains a histogram with opioid-related deaths broken down by age. The resulting plot shows that opioid-related deaths seem to fall largely within two age ranges: mid-20s to mid-30s and mid-50s to mid-60s. This is likely due to the many forms that opioid drugs take; opioids encompass both recreational heroin and its variants as well as a broad spectrum of painkillers.  To further understand demographic trends, counts were produced of all opioid-related deaths by race and then compared to racial demographics in the state of Connecticut. A Chi-squared test showed that generally, males were over-represented in the opioid category and white and hispanic males were significantly over-represented.

In order to understand social factors that might be tied to opioid use and death, two scatter plots were made examined the relationships between educational achievement across CT towns and the proportion of opioid deaths and wealth across CT towns and the proportion of opioid deaths. The scatter plot examining educational achievement vs. proportion of opioid-related deaths in particular showed a significant negative correlation via a Pearson's Correlation, suggesting that greater educational achievement (or the hope of future success that it promises) can help stave off a local opioid epidemic. Interestingly, some towns such as Bridgeport and Plainfield are outliers, showing that low % SAT benchmark achievement does not have to be closely tied to a high rate of opioid deaths; Hartford is at the opposite end of the spectrum, showing that even towns with overall high achievement can succumb to drug epidemics.

How can the local government intervene most effectively to prevent deaths?

In order to understand how the local government can help potential and current opioid-users, it must be able to measure the efficacy of current treatment strategies as well as pinpoint trackable sources of drugs.

For this project, the efficacy of government-funded opioid addiction treatment centres was measured by creating a map and plotting sites of annual opioids deaths against addiction treatment centres with at least one patient admitted in the same year (in both cases, 2016). This map demonstrates where many individuals are dying but do not have access to local treatment centres or where multiple treatment centres are present and few individuals are dying. Locations with high death counts but not treatment centres highlight areas where government funds should be focused for maximal benefit; similarly, areas where there are many treatment centres but few deaths require further investigation, as they could either represent areas with many patients that are handling treatment incredibly well or areas with few patients where centres could be closed and funds used elsewhere.

In order to pinpoint trackable sources of drugs, data was taken from the Kaggle "Opioid-Prescriber" dataset and opioid prescriptions written in Connecticut were sorted by medical specialty in order to create a bar graph. This information can be useful in helping the local government understand which doctors are writing the most prescriptions and should be tracked most closely. This data can be further analysed in order to find out which specific clinicians are writing the most prescriptions and for how many/which drugs.


Overall, this project provided valuable analysis to understand which groups are being affected by the opioid epidemic in Connecticut and what steps the local government can take to help them. It seems that both young (25-35 years old) and middle-aged (50-60 years old) individuals were highly affected and white and hispanic males were very over-represented in this group. Low educational achievement, as measured via % SAT benchmark achievement in each town, was highly correlated with proportion of the town population dying from opioid-related death, showing that social factors are also significant.

Positively, the map of treatment centre locations vs. locations of opioid-related deaths show where the local government could re-allocate resources in order to provide more help to areas in need. The bar graph depicting the number of opioid prescriptions written across various medical specialties can also begin to help the state government trace where opioid prescriptions are coming from and in which cases they can be stopped. Though this project is only a preliminary effort, it shows how publicly available data can be used to answer interesting and societally-relevant problems.

About Author

Katie Critelli

Katie Critelli

Katie graduated from the University of Pennsylvania with a Bachelor's degree in Neuroscience and an Honor's thesis focused on protein-modeling in neurodegenerative diseases. She worked previously at Booz Allen Hamilton in the military healthcare division. Katie has joined...
View all posts by Katie Critelli >

Related Articles

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

#python #trainwithnycdsa 2019 airbnb Alex Baransky alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus API Application artist aws beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep Bundles California Cancer Research capstone Career Career Day citibike clustering Coding Course Demo Course Report D3.js data Data Analyst data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization Deep Learning Demo Day Discount dplyr employer networking feature engineering Finance Financial Data Science Flask gbm Get Hired ggplot2 googleVis Hadoop higgs boson Hiring hiring partner events Hiring Partners Industry Experts Instructor Blog Instructor Interview Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter lasso regression Lead Data Scienctist Lead Data Scientist leaflet linear regression Logistic Regression machine learning Maps matplotlib Medical Research Meet the team meetup Networking neural network Neural networks New Courses nlp NYC NYC Data Science nyc data science academy NYC Open Data NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time Portfolio Development prediction Prework Programming PwC python python machine learning python scrapy python web scraping python webscraping Python Workshop R R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn Selenium sentiment analysis Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau team TensorFlow Testimonial tf-idf Top Data Science Bootcamp twitter visualization web scraping Weekend Course What to expect word cloud word2vec XGBoost yelp