Skip to content

The codes provided here enable users to explore and visualise the CCCSL dataset.

Notifications You must be signed in to change notification settings

amel-github/CCCSL-Codes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CCCSL: Complexity Science Hub COVID-19 Control Strategies List – Codes for exploration and visualisation

Update 2021-03-02

Purpose
Background & Summary of the Project
About the Data
Technical Validation of the CCCSL Dataset
Description of the CCCSL Dataset
Usage example of the CCCSL Dataset #1: Number of interventions versus incidence of COVID-19
Usage example of the CCCSL Dataset #2: Interactive world map of the number of interventions per country
Usage example of the CCCSL Dataset #3: Visualisation of the time-series of the date of NPI implementation using a heat map
Usage example of the CCCSL Dataset #4: Country-cluster analysis of the control strategies
Usage examples #3 and #4: Getting Started
Authors
License
Acknowledgements
Funding
Contact

Purpose

The codes provided here enable users to validate, explore, describe, and visualise the CCCSL dataset.
* Usages #1 and #2: The codes enable to reproduce the map as well as the bubble and bar plots displayed on our webpage.
* Usages #2 and #3: The codes enable to reproduce the figures presented in our publication.

Background & Summary of the Project

In response to the COVID-19 pandemic, governments have implemented a wide range of public health and social measures (PHSMs), also called non-pharmaceutical interventions (NPIs). Monitoring and documenting government strategies during the COVID-19 crisis is crucial to understand the progression of the epidemic.
The Complexity Science Hub COVID-19 Control Strategies List (CCCSL) project aims to generate a comprehensive and structured dataset on government responses to COVID-19, including the respective time schedules of their implementation.

The project webpage is accessible here.

About the Data

Our dataset presents PHSMs but also economic measures (EMs) implemented in response to COVID-19.

A dynamic version of the CCCSL dataset, which is continually updated, can be accessed via GitHub.

A static version of the dataset is provided on this repository.

Our methodology is published: Desvars-Larrive, A., Dervic, E., Haug, N. et al. A structured open dataset of government interventions in response to COVID-19. Scientific Data 7, 285 (2020). https://doi.org/10.1038/s41597-020-00609-9.

Technical Validation of the CCCSL Dataset

Three R scripts can be run to perform automated validations and summaries of the dataset:

Description of the CCCSL Dataset

File: Description_CCCSL_v2.Rmd
These codes are provided in form of R Markdown document.
To see all the results, knit it to .pdf (default output).
Explanation for the codes are displayed in the R Markdown documents.

Usage example of the CCCSL Dataset #1: Interactive world map of the number of interventions per country

This map shows the number of government interventions per country that are reported in the CCCSL dataset.
File: WorldMap.R
Output: Interactive html-map

Usage example of the CCCSL Dataset #2: Number of interventions versus incidence of COVID-19

This script enables to plot the number of reported interventions (theme level/L1_Measures) in the CCCSL dataset per country and per day in form of bubbles/horizontal lines and compared it with the smoothed linear/logarithmic progress of daily new COVID-19 confirmed cases per million people.

  • Results and visualizations can be produced by running Main_program.R.

  • Below, follows a short description of the different files:

  1. Functions.R: contains the functions used by the various algorithms.

  2. Plot_options: contains the format settings for the plots.

  3. Plot_L1-measures_timeline_bubbles.R: produces one graph containing all the countries and one graph for every country within the CCCSL dataset showing the number of implemented government interventions per day and per L1-category as bubbles over a timeline.

  4. Plot_L1-measures_timeline_lines.R: produces three graphs containing all the countries and one graph for every country within the CCCSL dataset showing the number of implemented government measures per day and per L1-category over a timeline.

  5. Combine_timeline_plots.R: combines the bubbles and timeline # graphs into one graphical file.

We used data on the number of COVID-19 cases provided by Our World in Data.

Usage example of the CCCSL Dataset #3: Visualisation of the time-series of the date of NPI implementation using a heat map

We propose to visualise the time series of the dates of implementation of the NPIs recorded in the CCCSL at level 2 (categories) in the 56 countries using a heat map. To highlight country-based differences in the timeline of implementation thorough the epidemic, we used the epidemic age instead of calendar time and considered t0 as the day when the number of confirmed cases reaches 10.

We used the time-series of the number of COVID-19 cases provided by the Johns Hopkins University Center for Systems Science and Engineering, accessible via Github: https://github.com/CSSEGISandData/COVID-19.

Usage example of the CCCSL Dataset #4: Country-cluster analysis of the control strategies

The cluster analysis partitions the countries on the aggressiveness of the control strategy (number of measures) and responsiveness (timeline). We focused on the compulsory measures (i.e. theme “Risk communication” was not included) recorded in the CCCSL at level 2 (categories) that appeared in at least 15 countries.

Method used: k-means clustering. The clustering algorithm used the date of implementation of the interventions in each country, based on the epidemic age. We considered:

  • “Anticipatory measures” as those implemented before day when 10 cases were reported;

  • “Early measures” as those implemented at the beginning of the epidemic, i.e. between day when 10 cases were reported and day when 200 cases were reported;

  • “Late measures” as those implemented in a later stage of the epidemic, i.e. after day when 200 cases were reported. The algorithm also takes into account the number of measures implemented at these different epidemic ages.

We used the time-series of the number of COVID-19 cases provided by the Johns Hopkins University Center for Systems Science and Engineering, accessible via Github: https://github.com/CSSEGISandData/COVID-19.

Usage examples #3 and #4: Getting Started

These instructions will get you a copy of the project up and running on your local machine for testing purposes.

Prerequisites

  • Installed/updated R (R version 3.6.1 (2019-07-05) ) and RStudio (Version 1.2.1335 © 2009-2019 RStudio, Inc.)

Installing

Install and load packages:

  • countrycode (1.1.1)

  • dplyr (0.8.5)

  • factoextra (1.0.7)

  • ggplot2 (3.3.0)

  • plot3D (1.3)

  • plotly (4.9.2.1)

  • RColorBrewer (1.1-2)

  • reshape2 (1.4.3)

  • reticulate (1.15)

  • stringr (1.4.0)

  • tidyverse (1.3.0)

  • vegan (2.5-6)

  • incidence (1.7.0)

  • RColorBrewer (1.1-2)

  • kableExtra (1.1.0)

To automatically install all packages, run the following:

my_packages <- c("countrycode", "dplyr", "factoextra", "ggplot2", "plot3D", "plotly", 
                 "reshape2", "reticulate", "stringr", "svglite", "tidyverse", "vegan",
                 "incidence", "stringr","RColorBrewer", "kableExtra")  

# Extract not installed packages
not_installed <- my_packages[!(my_packages %in% installed.packages()[ , "Package"])]    

# Install not installed packages
if(length(not_installed)) install.packages(not_installed)                           

Running the tests

Results and visualizations can be produced by running Main_Script.Rmd. Below you can find a list of the steps of our analysis and visualization.

Step 1

This script creates binary representations of the CCCSL data set on category (L2) * make_binary_measure_tables.R

Step 2

Download the data from COVID-19 Data Repository by the Center for Systems Science and Engineering (CSSE) at Johns Hopkins University * Get_JohnsHopkins_data.R

Step 3

Read data from the binary file take names of all countries, all L1 measures, all L2 measures. * Get_measures_data.R

Step 4

Heat map of the timeline of NPI implementation by country. We used the epidemic age instead of calendar time and considered t0 as the day when the number of confirmed cases reaches 10.

To plot and save the Measures_Countries_time_of_activation_zeroday10cases.png and Measures_Countries_time_of_activation_zeroday10cases.eps * Plot_heatmap_activation_of_measures_zeroday_10cases.R

Step 5

In order to partition the countries based on the aggressiveness of the control strategy (number of measures) and responsiveness (timeline), we propose a k-means clustering method.

To calculate the clustering and visualise the results, run Clustering_kmeans.R

Each country is characterised with regard to the number of anticipatory, early, and late measures.
x-axis: late measures;
y-axis: early measures;
z-axis: anticipatory measures.

An interactive version of the clustering graph is available online at: http://covid19-interventions.com/CountryClusters.html.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the CC BY-SA 4.0 License - see the CC BY-SA 4.0 file for details.

Acknowledgements

Funding

EOSCsecretariat.eu has received funding from the European Union’s Horizon Programme call H2020-INFRAEOSC-05-2018-2019, grant Agreement number 831644.

Contact

Amélie Desvars-Larrive (Complexity Science Hub Vienna, Austria / University of Veterinary Medicine Vienna, Austria).
Email: desvars@csh.ac.at