Final Project - Opioid Overdoses in Florida

 For this project, I chose to research a troubling issue in the world today. Opioid addiction and overdose have been an ever-growing problem, leading to many deaths due to overdose. For my research, I used this dataset: US Opioid Overdose Deaths (kaggle.com) which includes the number of deaths from overdose for every US state from 1999-2014. For the purpose of this project, I chose to use the Florida statistics as my sample to establish a hypothesis. 

My hypothesis:

    H1: The number of opioid overdose deaths in Florida has significantly increased from the earlier period of 1999-2004 to the later period of 2009-2014.

    H0: There is no significant difference in the number of opioid overdose deaths in Florida between the earlier period of 1999-2004 compared to the later period of 2009-2014.


Related work:

For this project I used my knowledge from Module 6, where the class learned how to conduct one sample t-tests, two sample t-tests, and paired t-tests. I also used knowledge of how to analyze P-value and mean.


Solution:

First, I created a data frame using the Florida sample. I also created a grouping variable of 1999-2004 and 2009-2014 for my t-test.  

> years <- c(1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014)
> deaths <- c(417, 571, 890, 1001, 1080, 1258, 1151, 1323, 1519, 1523, 1654, 1739, 1637, 1383, 1327, 1446)
> opioid_data <- data.frame(year = years, deaths = deaths)
> opioid_data$group <- ifelse(opioid_data$year <= 2004, "1999-2004", "2009-2014")

Next, I conducted a t-test.

> t.test(opioid_data$deaths ~ opioid_data$group)

Welch Two Sample t-test

data:  opioid_data$deaths by opioid_data$group
t = -4.2338, df = 6.9574, p-value = 0.003923
alternative hypothesis: true difference in means between group 1999-2004 and group 2009-2014 is not equal to 0
95 percent confidence interval:
 -936.6121 -264.7879
sample estimates:
mean in group 1999-2004 mean in group 2009-2014 
                  869.5                  1470.2 

I also created a scatter plot to visualize the trends in the data more clearly.



From this plot, you can clearly see the upward trend in overdose deaths from 1999-2014, with a spike in 2010.


Conclusion:

Based off the p-value obtained from the t-test, I can conclude that my hypothesis is true.

The p-value of 0.003923 is significantly less than the significance value of 0.05, providing evidence to suggest that there is a significant difference between the number of opioid overdose deaths from the earlier period of 1999-2004 and the later period of 2009-2014.

















Comments

Popular posts from this blog

Module #11 Assignment

Module #12 Assignment

Module #9 Assignment