Posts

Showing posts from November, 2023

Final Project - Opioid Overdoses in Florida

Image
 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 pa...

Module #12 Assignment

Image
First, I assigned the credit card data to a data frame.: credit_card_data <- data.frame(   Month = c("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"),   `2012` = c(31.9, 27, 31.3, 31, 39.4, 40.7, 42.3, 49.5, 45, 50, 50.9, 58.5),   `2013` = c(39.4, 36.2, 40.5, 44.6, 46.8, 44.7, 52.2, 54, 48.8, 55.8, 58.7, 63.4)    Next I called on ggplot 2 and created the time series plot: library(ggplot2) credit_card_ts <- ts(t(credit_card_data[, -1]), start = c(2012, 1), frequency = 12) matplot(credit_card_ts, type = "l", lty = 1, col = 1:ncol(credit_card_ts),         xlab = "Time", ylab = "Charges", main = "Monthly Credit Card Charges") Next, I employed the exponential soothing model: credit_card_model <- HoltWinters(credit_card_ts, beta = FALSE, gamma = FALSE) print(credit_card_model) Holt-Winters e...

Module #11 Assignment

 11/6/2023 10.1 library(ISwR) data(ashina) data ashina$subject <- factor(1:16) attach(ashina) act <- data.frame(vas=vas.active, subject, treat=1, period=grp) plac <-data.frame(vas=vas.plac, subject, treat=0, period = grp) first I created the model:  additive_model <- aov(vas ~ treat + subject + period, data = rbind(act, plac)) > anova(additive_model) Analysis of Variance Table Response: vas Df Sum Sq Mean Sq F value Pr(>F) treat 1 14706 14706.1 10.413 0.005644 ** subject 15 51137 3409.2 2.414 0.049184 * Residuals 15 21184 1412.3 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > t_test_1 <- t.test(vas ~ treat, data = ashina, subset = period == 1) > t_test_2 <- t.test(vas ~ treat, data = act, subset = period == 2) 10.3 > model_1 <- lm(z ~ a * b) model_2 <- lm(z ~ a:b) Call: lm(formula = z ~ a * b) Coefficients: (Intercept) ...