Data Analysis on Opioid Death Rates Across USA
The skills the author demoed here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.
LinkedIn | Github | Shiny App
Introduction
Drug overdose has been a major crisis in the United States. According to data from CDC, Drug overdose was the leading cause of injury related death in USA in 2018; 70% of these overdose deaths involved some form of opioid.
With my web application, I wanted to make an interactive tool to look at state level trends of drug overdose deaths from 2009 to 2018.
The App
The name of this app is 'Opioid Death Analysis' and below is a walkthrough of what you can find in the app.
- Overview - This page has three graphs. The first graph shows the yearly trend of death rates for overdose and opioid going from 2009 to 2019. The second graph is a bar graph that is comparing overdose to opioid death rates over the 10 years. The last graph in the bottom is a box plot which is showing the distribution of the death rates for all 50 states from 2009 to 2018.
- Interactive Graphs - This page is users to interact with the data. They have the option to pick year and state to see a customized graph. The first graph on this page is a bar plot of all 50 states death rates for a given year. The user can pick the year that they want to see the bar plot for. The second graph is a side by side comparison of overdose and opioid death rates. The user can pick 3 states and the graph will produce 3 line graphs for each death rate category. The last graph is a bar graph to see the death rate (overdose and opioid) for a particular state over 10 years. The user can pick a state and see its bar chart.
- Map Visualization - This page shows a heatmap across USA. The color bar shows death rate where high being darker color and vice versa. The user can pick a year and the death type (overdose or opioid) and the graph will produce a heatmap with the chosen criteria. There are also 4 infoboxes on the top right side that will show you the top two states which have the highest overdose and opioid death rate for that year.
- Data Table - There you can find the data that was used to make the visualizations.
- About Project - This tab gives a small description about the work done.
- About Me - Here you can find information about ways you can reach me.
Future Work
This app is still under development. For future work, I am looking into citywide and countywide data and I want to incorporate data points on age, ethnicity and income level.
Data Cleaning
The raw data separated into columns by year and state. I used the Tidyverse packages (readr, tidyr, dplyr) to clean the data and combine all the year columns into one. The graphs were made using ggplot2 library.
About Dataset
The dataset was collected from Kaiser Family Foundation (KFF) website. KFF used CDC & the National Vital Statistics System to extract data from cause-of-death mortality files.