OxCGRT - CoronaNet Taxonomy Map
0 Introduction
This document maps the Oxford Covid-19 Government Response Tracker (OxCGRT) taxonomy used to document government policies made in response to COVID-19 into the CoronaNet taxonomy. Each section maps the general area for which the taxonomy is mapped and each sub-section provides further detail as necessary. Following each explanation for how the mapping is conceptualized, there is R code for operationalizing this mapping. Please refer to the OxCGRT Documentation accessible through their github and the CoronaNet Codebook for more information on their respective taxonomies.
Note that the code below is customized to adjust for errors and idiosyncrasies in the OxCGRT data as of September 10, 2021. You can access (i) this original version of the OxCGRT dataset, “OxCGRT_latest_withnotes.csv” as well as (ii) the version which transforms this version of the OxCGRT dataset into the CoronaNet taxonomy “ox_coronanet_map.csv.gz” (the rest of this document details how this transformation was implemented) from the CoronaNet pubic git repo.1 Setup
To create replicate this taxonomy mapping exercise, users will need to load the following R packages and to read in the original OxCGRT data.
# load packages
library(readr)
library(magrittr)
<<<<<<< Updated upstream:RCode/collaboration/oxcgrt/oxcgrt_coronanet_taxonomy.html
library(dplyr)
library(tidyr)
library(lubridate)
library(stringr)
library(here)
# read in data
= read.csv(here("data", "collaboration", "oxcgrt", "OxCGRT_latest_withnotes.csv"), na.strings=c("","NA"))
ox_notes colnames(ox_notes) = gsub('\\.', ' ', colnames(ox_notes))
# string to match urls
<- "http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+" url_pattern
2 Data Preparation
2.1 One-to-one mappings
The following code identifies the variables for which there is a one-to-one relationship between the OxCGRT data and the CoronaNet taxonomy.
Becauase the OxCGRT data does not itself possess unique ids to track different policies, we create one for them. We create this
ox_id
by pasting the following variables together:- The name of the country a policy originates from (from the
CountryName
variable) - If available the region within the country is used (from the
RegionName
variable) - and the start date of the policy and putting them together (from the
Date
variable) - An example of an id that does not have any region information associated with it would be ‘Aruba_20200310’.
- The name of the country a policy originates from (from the
ox_id_num
is added as an additional identifying feature of a policy by using the row number the policy is stored in.OxCGRT’s
CountryName
variable andCountryCode
variable, which capture the name and ISO code of the initiating country, are perfect matches for Coronanet’scountry
variable andISO_A3
variable. However not, because OxCGRT and CoronaNet consider a number of countries differently in terms of sovereignty a few of the ISO_A3 codes have to be adjusted.- E.g. Guam is consisdered a province in the CoronaNet dataset as opposed to a country in the OxCGRT dataset. It is therefore assigned USA as ISO_A3 code to reflect its status as a province in the CoronaNet dataset. The same is true of Puerto Rico and the U.S. Virgin Islands.
OxCGRT’s
Region
variable andRegionCode
variable, which captures information on the initiating ISO level 2, are perfect matches for Coronanet’sprovince
variable andISO_L2
variable.OxCGRT’s
Jurisdiction
variable captures information on the level of government initiating a policy, which matches CoronaNet’sinit_country_level
variable and can therefore be mapped as is.
= ox_notes %>%
ox_notes mutate(ox_id = ifelse(
is.na(RegionName), paste(CountryName, Date, sep = '_'), paste(CountryName, RegionName, Date, sep = '_')
)
)$ox_id_num = seq.int(nrow(ox_notes))
ox_notes= c(
types 'C1_School closing',
'C2_Workplace closing',
'C3_Cancel public events',
'C4_Restrictions on gatherings',
'C5_Close public transport',
'C6_Stay at home requirements',
'C7_Restrictions on internal movement',
'C8_International travel controls',
'H1_Public information campaigns',
'H2_Testing policy',
'H3_Contact tracing',
'H4_Emergency investment in healthcare',
'H5_Investment in vaccines',
'H6_Facial Coverings',
'H7_Vaccination policy',
'H8_Protection of elderly people'
)= ox_notes %>%
ox2coronanet # remove empty rows
mutate(dum = rowSums(across(types), na.rm = TRUE)) %>%
filter(dum != 0) %>%
# convert dates
mutate(Date = ymd(Date)) %>%
# convert geographic names
mutate(country =
case_when(
== "GUM" ~ "United States",
CountryCode == "PRI" ~ "United States",
CountryCode == "VIR" ~ "United States",
CountryCode TRUE ~ CountryName
),
province =
case_when(
== "GUM" ~ "Guam",
CountryCode == "PRI" ~ "Puerto Rico",
CountryCode == "VIR" ~ "United States Virgin Islands",
CountryCode TRUE ~ RegionName
),ISO_A3 = case_when(
# CountryCode == "ABW" ~ "NLD",
# CountryCode == "BMU" ~ "GBR",
# CountryCode == "FRO" ~ "DNK",
# CountryCode == "GRL" ~ "DNK",
== "GUM" ~ "USA",
CountryCode == "PRI" ~ "USA",
CountryCode == "VIR" ~ "USA",
CountryCode == "RKS" ~ "XKX",
CountryCode TRUE ~ CountryCode),
ISO_L2 = RegionCode,
init_country_level =
case_when(
== "Guam"~ 'Provincial',
province == "Puerto Rico"~ 'Provincial',
province == "United States Virgin Islands"~ 'Provincial',
province == 'NAT_TOTAL' ~ 'National',
Jurisdiction == 'STATE_TOTAL'~'Provincial',
Jurisdiction TRUE ~ as.character(NA)) )
3.1 Social Distancing
The following code maps how COVIDAMP captures social distancing policies to the CoronaNet taxonomy. While when there is no one to one matching of the Social distancing
Policy_category
to the CoronaNet taxonomy, it is possible to use thePolicy_subcategory
to create one to one matchings for thetype
variable in the CoronaNet taxonomy. In particular, the following code matches the following for policies that take on the value of Social distancing in thePolicy_category
variable::Observations that take on the value of Other forms of social distancing, Visitor restrictions, Distancing mandate, Face covering or takes on no value in
Policy_subcategory
variable can be mapped as Social Distancing for thetype
variable in the CoronaNet taxonomy.Observations that take on the value of Lockdown, Stay at home, Safer at home or Isolation in the
Policy_subcategory
variable can be mapped as Lockdown for thetype
variable in the CoronaNet taxonomy.Observations that take on the value of Alternative election measures, Public service closures or Election delays in the
Policy_subcategory
variable can be mapped as Restriction and Regulation of Government Services for thetype
variable in the CoronaNet taxonomy.Observations that take on the value of Private sector closures or Adaptation and mitigation measures in the
Policy_subcategory
variable can be mapped as Restriction and Regulation of Businesses for thetype
variable in the CoronaNet taxonomy.Observations that take on the value of Mass gathering restrictions, Event delays or cancellations, or Prison population reduction in the
Policy_subcategory
variable can be mapped as Restrictions of Mass Gatherings for thetype
variable in the CoronaNet taxonomy.Observations that take on the value of School closures in the
Policy_subcategory
variable can be mapped as Closure and Regulation of Schools for thetype
variable in the CoronaNet taxonomy.Observations that take on the value of Quarantine in the
Policy_subcategory
variable can be mapped as Quarantine for thetype
variable in the CoronaNet taxonomy.Observations that take on the value of Curfews in the
Policy_subcategory
variable can be mapped as Curfew for thetype
variable in the CoronaNet taxonomy.Observations that take on the value of Health screening in the
Policy_subcategory
variable can be mapped as Health Monitoring for thetype
variable in the CoronaNet taxonomy.