Giter Site home page Giter Site logo

coverage_plot's Introduction

COVerAge_Plot : Age Pyramid for the COVerAGE-DB Dataset

COVerAGE-DB dataset project page

Plots using the harmonized dataset (Output_5.zip)

The Github page (updated in February 2022) shows the aggregated plots for global cases and deaths based on the 5-year age interval harmonized datasets from COVerAGE-DB The pages are rendered from the .Rmd files.

Age distribution of global COVID-19 cases and deaths Total

Age distribution of global COVID-19 cases and deaths by sex BySex

Plots using the raw input dataset (inputDB.zip)

Notice that it's harder to work on the input database directly now since it is quite large (~1.5GB). The cleaning step might take an hour.

The script plot_raw_dataset.R walks through the process

Download raw data from OSF: https://osf.io/mpwjq/

source("plotting_funcs.R") # all the plotting functions
source("00_Functions_convert_to_count.R") # borrow to distribute total if Metric is "Fraction"
inputDB <- refresh_data() # re-download and calculate fraction into numbers 

This cleaning step might take an hour:

dt1 <- clean_inputDB(inputDB = inputDB)

Country-specific plot

  • Age pyramid for each country showing Cases, Deaths, and CFR (Death/Case), whichever is available
  • Showing sex-specific if available
  • Showing in title the latest date used as it is different for each country
all_countries <- get_cnames(dt1)
cname0 <- all_countries[1]
p1 <- make_country_plot(cname0)

Afghanistan

Aggregated plots for all countries

  • Only choose those with both case and death data with matching age intervals, thus can calculate CFR
  • By assigning a common age interval, only those countries whose age interval are adaptable are used (i.e. through combining intervals into a wider one, 0-5 & 5-10 -> 0-10)
  • Fewer countries will be included if set a stricter/narrower interval, or set get_f_m = TRUE to ask for sex-specific data
# this example shows the countries available with 0 to 80 by 10 years age intervals
data_total1 <- rbindlist(lapply(all_countries, get_dt_for_total, 
                                data = dt1,
                                target_interval = seq(0, 80, by = 10),
                                get_f_m = TRUE))
# a three-panel plot (Case, Death, CFR) for a specific given interval
g1 <- plot_aggregated_total(data_total1)

Aggregated

coverage_plot's People

Contributors

liuyanguu avatar

Stargazers

Xinhu Wang avatar Christian Dudel avatar Tim Riffe avatar  avatar

Watchers

 avatar

Forkers

aprilxwang

coverage_plot's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.