Measles is a disease that we have fought in the past so much and had such deadly consequences on us when we didn't have anything to protect ourselves from the disease. My team and I have been researching and collecting data to see if there are any correlations between the disease and our so-called "solution" to the problem of measles. I know some of the population still speculate about the "cure" and want concrete proof, and I believe I have that piece of the picture for them. I am here to put all of our minds at ease, and to show that vaccinations truly do help us in the battle against measles, but that this problem is a thing of the past now.
#Code
measles <- read.csv("~/HW Ant/measles.csv")
data1 = measles[measles$year >= 1980,]
data1 = data1[order(data1$year, decreasing=FALSE),]
colors <- c("darkblue", "darkgreen", "darkred")
barplot(data1$measles.cases/ 1000000, col = colors, names.arg = data1$year, xlab = "Year",ylab = "Cases in Millions", main = "Cases of Measles throughout the years of 1980-2017")
As we can see from the graph, in the 1980s measles was rampant among the population, infecting millions at a time and causing devastating effects on families and individuals. As time progressed, so did our solution to this problem, and as the general population started to get more educated on Measles, so did our rates of avoidance of this pathogen. We can see in the period 1980-1984, measles was at its peak at the time, but as the general population started to understand how to avoid measles by vaccination, the number of cases went down drastically.
#Question 2
As we compared the year to how many people got sick in that year with measles, we also got data on the vaccination rates of the people in those specific years as well. We are trying to see if this case is correlation or causation. The vaccination was released to the public in 1963 and has only advanced and become a normal staple thing to do for everyone alike. We have also gotten a lot more educated on how to deal with these diseases, quarantining, personal hygiene, and vaccinations to lower the chances of getting these pathogens for good.
measles <- read.csv("~/HW Ant/measles.csv")
library(plotly)
data1 = measles[measles$year >= 1985 & measles$year <= 2005,]
data1 = data1[order(data1$year, decreasing=FALSE),]
data_vac <- data1$vaccination.coverage
cases <- data1$measles.cases/ 1000000
plot_ly(x = ~data_vac, y = ~cases, type = "scatter", mode = "markers",
marker = list(color = "pink")) %>%
layout(xaxis = list(title = "Vaccination Coverage in Percentage"),
yaxis = list(title = "Measles Cases in Millions"),
title = "Scatter Plot of Vaccination Coverage vs Measles Cases")
As we can see from this scatter plot, from 1985-2005, we can see that the population at the time had only around 50 percent vaccination rates when the cases were at around 2 million. As more and more people get vaccinated, to around 70 percent, the measles cases have gone down a drastic 60-70 percent, and even as high as around 75 percent! There were only around five hundred thousand cases when there was a vaccination rate of 76 percent, a huge improvement from the 4 million we used to face back in the 1980s!
measles <- read.csv("~/HW Ant/measles.csv")
library(plotly)
Cases = measles$measles.cases / 1000000
bar = plot_ly(x = measles$year, y= Cases, type = "bar", name = "measles Cases" ) %>%
layout(xaxis = list(title = "Years"),
yaxis = list(title = "Cases in Millions"),
title = list(text = "Cases of measles by the year, with vaccination coverage"))
Both = add_trace(p=bar, x=measles$year, y=measles$vaccination.coverage, type = "scatter", mode = "lines", name = "Vaccination Coverage Percentage", yaxis="y2")%>%
layout(yaxis2 = list ( overlaying = "y",
side = "right",
title = "Vaccination Coverage"))
Both