Thursday, February 4, 2021

CT Covid Data Transparency

 I was  really annoyed that the CT Covid Data portal map is more or less useless in the current covid crisis. 

 

 

 From https://portal.ct.gov/Coronavirus/COVID-19-Data-Tracker

 

I decided to see if I could make an more meaningful map of current case rates (really most recent data is only to Jan 23, 2021). After some wrangling of CT Town GIS data and the data available at the portal above, I created a snapshot of current cases broken down by quantile (20% of data in each bin). 

 Here you can clearly see that case rates are extremely variable, and concentrated in Eastern CT, Hartford area, and scattered towns in Western CT. It's not perfect. If there were meaningful more meaningful breaks (e.g. what level of overall infection could represent herd immunity, or very active community transmission) these tools could be even more improved so people would know the risk of infection in any given town. That being said, given our automobile nature, transmission is not going to be mediated just by infection rates of current residents.




R Code to produce image is below. Town Polygons are from https://ct-deep-gis-open-data-website-ctdeep.hub.arcgis.com/datasets/connecticut-towns-set?layer=1

# ct covid vis
# zjgrabowski, feb 4, 2021
library(tmap)
library(spatial)
library(rgdal)
library(sf)

setwd("/Users/grabowsz/Google Drive/COVID/ct covid/")
ct.covid <- read.csv("data-VWkVr.csv")
names(ct.covid)
head(ct.covid)
ogrListLayers("Connecticut_Towns_Set-shp/")
ct.towns<-readOGR("Connecticut_Towns_Set-shp/","Town_Polygon")
ct.towns.sf <- as(ct.towns,"sf")
unique(ct.towns.sf$COAST_POLY)
# clean up the weird polygons of water and islands
ct.towns.sf <- ct.towns.sf[grep("Inland",ct.towns.sf$COAST_POLY),]

names(ct.towns.sf)
head(ct.towns.sf)

ct.towns.covid <- merge(ct.towns.sf,ct.covid, by.x = "TOWN", by.y = "NAME")

tm_shape(ct.towns.covid)+
  tm_polygons(col = "CaseRate",style = "quantile")