weiluwang0627 / covid19

0 stars 0 forks source link

Plot excess deaths and covid-registered UK deaths #1

Open mirams opened 4 years ago

mirams commented 4 years ago

There are three sources of death data:

  1. Daily announced deaths
  2. ONS deaths by date they occurred
  3. ONS excess deaths relative to this time of year on average

Plot all of these and compare.

There should also be data on deaths in care homes available from ONS https://www.ons.gov.uk/peoplepopulationandcommunity/birthsdeathsandmarriages/deaths/articles/deathsinvolvingcovid19inthecaresectorenglandandwales/deathsoccurringupto12june2020andregisteredupto20june2020provisional

see if you can plot that too

weiluwang0627 commented 4 years ago

Following is my code to plot them and the dataset is downloaded from the ONS website:

put into the ONS dataset of deaths

data <- read_excel("Desktop/death_data.xlsx") view(data)

cdeath <- data$ONS Deaths involving COVID-19# deaths population caused by covid_19 total <- data$ONS All deaths year-to-date # total deaths of this year ldeath <- data$ONS 2019 # deaths population of 2019 time <- as.Date(data$Date) days <- seq(0,166,1)

plot

df = data.frame(days,ldeath,cdeath,total) factor(ldeath) factor(cdeath) ggplot(df)+ geom_line(aes(x = days, y = total, col = '2020 Total Death Population'))+ geom_line(aes(x = days, y = ldeath, col='2019 Total Death Population'))+ geom_line(aes(x = days, y = cdeath, col='Death Population Caused by COVID-19'))+ ggtitle("Death Population Summary")+ labs(x = "Days", y = "Populations")+ scale_colour_manual("", values=c( "Death Population Caused by COVID-19" = "cornflowerblue", "2019 Total Death Population" = "orange", "2020 Total Death Population" = "forestgreen" ) ) + scale_y_continuous('') scale_color_discrete(name = "TITLE", labels = c("2020 Total Death Population", "2019 Total Death Population", "Death Population Caused by COVID-19"))