Introduction

This is from daily case count by age, as released by OHA daily on this page. The page was updated daily at the start of the pandemic, and on week days only in recent months. The data used is as of April 23.

The age distribution of confirmed cases on Oregon’s COVID page is known as of the date of testing, but the hospitalization status is added retrospectively by human researchers. Because the hospitalizations status is still unknown for so many Oregonians (the gray region on this OHA visualization) we did not use it further in this analysis.

Data Source

# Libraries
library(ggplot2)
library(dplyr)
library(scales) 


# See above for files used in this analysis
file = "age_percents_days.csv"
weekly_file = "age_percents_weeks.csv"

age <- read.csv(file=file, header=TRUE, sep=",")
age$dateob = as.Date(age$date)

ageweekly <- read.csv(file=weekly_file, header=TRUE, sep=",")
ageweekly$dateob = as.Date(ageweekly$date)

Count by week

ggplot(data= ageweekly, aes(x=dateob))  + geom_line(aes(y= X20_to_29_cases_new, color = "Other Ages")) + geom_line(aes(y=X30_to_39_cases_new, color = "Other Ages")) + geom_line(aes(y=X40_to_49_cases_new, color="Other Ages")) + geom_line(aes(y=X50_to_59_cases_new, color="Other Ages")) + geom_line(aes(y=X60_to_69_cases_new, color="Other Ages")) + geom_line(aes(y=X70_to_79_cases_new, color="Other Ages")) + geom_line(aes(y=X80_and_over_cases_new, color="80+")) + geom_line(aes(y= X0_to_9_cases_new, color = "0-9")) + geom_line(aes(y= X10_to_19_cases_new, color = "10-19")) + xlim(as.Date('2020-06-01'), as.Date('2021-04-27')) + theme(legend.title = element_blank(), legend.position = c(0.25, 0.9), legend.direction = "horizontal")  + xlab('') + ylab('Number Of Weekly Cases By Age')  + labs(title = "Count Of New Weekly Covid Cases By Age And Week") + labs(caption="Source: Oregon Health Authority. Graphic: Jacob Fenton.") + theme( plot.caption = element_text(size = 8,hjust = 0), axis.title=element_text(size=10)) + scale_color_manual(values = c("red", "orange", "blue", "gray")) 

Percent by week

ggplot(data= ageweekly, aes(color="Other Ages", x=dateob))  + geom_line(aes(color="Other Ages", y= case_prcnt_20_to_29)) + geom_line(aes(color="Other Ages", y=case_prcnt_30_to_39)) + geom_line(aes(color="Other Ages", y=case_prcnt_40_to_49))  + geom_line(aes(color="Other Ages", y=case_prcnt_50_to_59)) + geom_line(aes(color="Other Ages", y=case_prcnt_50_to_59)) +  geom_line(aes(color="Other Ages", y=case_prcnt_60_to_69)) +  geom_line(aes(color="Other Ages", y=case_prcnt_70_to_79))  + geom_line(aes(color="10-19", y= case_prcnt_10_to_19)) + geom_line(aes(color="0-9", y= case_prcnt_0_to_9))  +  geom_line(aes(color="80+", y=case_prcnt_80_and_over)) + xlab('') + ylab('Percent Of Weekly Cases') + xlim(as.Date('2020-07-01'), as.Date('2021-04-27')) + labs(title = "Fraction Of New Weekly Covid Cases By Age") + labs(caption="Source: Oregon Health Authority. Graphic: Jacob Fenton.") + theme( plot.caption = element_text(size = 8,hjust = 0), axis.title=element_text(size=10))+ ylim(0,30) + scale_color_manual(values = c("orange", "red", "blue", "gray"))  + theme(legend.title = element_blank(), legend.position = c(0.25, 0.9), legend.direction = "horizontal")