We will pull the model for the localities that have colleges that have reopened in or near them. For each such locality we will look for any obvious change in model parameters around the time of the relevant reopenings.
library(CovMitigation) library(dplyr) library(stringr) library(ggplot2) read_model_data <- function(dir) { filepat <- 'filter-fit-(.*)\\.rds' savefiles <- list.files(path=dir, pattern=filepat) localities <- str_match(savefiles, filepat)[,2] savefiles <- file.path(dir,savefiles) mods <- lapply(savefiles, readRDS) names(mods) <- localities mods }
models <- read_model_data(here::here('analysis','filter-updates.2021-05-23')) models <- models[names(models) %in% va_college_reopening$locality]
makeplot <- function(loc, var='beta') { reopendata <- filter(va_college_reopening, locality==loc) modelfit <- models[[loc]][['modelfit']] modelfit$date <- as.Date(modelfit$time, origin='2020-01-01') modelfit$value <- modelfit[[var]] dmax <- max(modelfit$value) ggplot(modelfit, aes(x=date,y=value)) + geom_line(size=1.2) + geom_vline(data=reopendata, mapping=aes(xintercept=date, color=School), size=1.2) + ggtitle(loc) + ylab(var) + coord_cartesian(ylim=c(0,dmax)) + #coord_cartesian(ylim=c(0,1.5)) + theme_bw() } beta_plots <- lapply(names(models), makeplot) for(plot in beta_plots) { print(plot) }
import_plots <- lapply(names(models), makeplot, var='import_cases') for(plot in import_plots) { print(plot) }
enrichment_plots <- lapply(names(models), makeplot, var='b0') for(plot in enrichment_plots) { print(plot) }
For both beta
(transmissibility) and import_cases
(daily case importation rate),
The only locality that shows an obvious response is Harrisonburg City, where beta
jumps from about 0.25 to over 3 in the second week following reopening. The import
rate also roughly quadruples during that time.
This makes some sense because JMU was a COVID-19 hotspot in the weeks following
reopening; however, Radford and Virginia Tech also had outbreaks; yet, the
Radford City, Pulaski County, and Montgomery County don't show any effect in beta
,
and except for an uptick from 1.5 to 3 in Montgomery County, there's no effect in
import_cases
either. Therefore, our next question is, what was different in the
Radford/VT area as compared to JMU?
localities <- c('Lynchburgcity','Harrisonburgcity', 'MontgomeryCounty', 'Radfordcity', 'PulaskiCounty', 'AlbemarleCounty', 'Charlottesvillecity') models2 <- models[localities] dgplots <- lapply(models2, filter_model_diagnositc_plots) caseplots <- lapply(localities, function(loc) { plt <- dgplots[[loc]][['cases']] reopen <- filter(va_college_reopening, locality == loc) plt + geom_vline(data=reopen, mapping=aes(xintercept=date, color=School), size=1.2) }) for(plt in caseplots) { print(plt) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.