Skip to content

Instantly share code, notes, and snippets.

@clauswilke
Created March 17, 2020 02:57
Show Gist options
  • Save clauswilke/0621446f461049a9556c8372d5bc8a9b to your computer and use it in GitHub Desktop.
Save clauswilke/0621446f461049a9556c8372d5bc8a9b to your computer and use it in GitHub Desktop.

Revisions

  1. clauswilke created this gist Mar 17, 2020.
    51 changes: 51 additions & 0 deletions CFR.Rmd
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,51 @@
    ---
    title: "COVID-19 Case Fatality Rate (CFR) by age"
    output: html_document
    ---

    ```{r setup, include=FALSE}
    knitr::opts_chunk$set(echo = TRUE)
    library(tidyverse)
    ```

    Seasonal influenza 1997 to 2007 CFR (taken from https://github.com/jbloom/CoV_vs_flu_CFR/blob/master/cfr_stats.ipynb, original source Table 1 of https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3873104/ assuming a 10% incidence rate)

    COVID-19 CFR data taken from Table 1 from https://www.imperial.ac.uk/media/imperial-college/medicine/sph/ide/gida-fellowships/Imperial-College-COVID19-NPI-modelling-16-03-2020.pdf

    ```{r}
    flu <- read_csv(file =
    "label,age,CFR
    <18,9,0.0041
    18-49,33,0.0103
    50-64,57,0.0718
    65-74,70,0.2637
    >=75,80,1.4115")
    flu$disease = "seasonal influenza"
    covid19 <- read_csv(file =
    "label,age,CFR
    0-9,5,0.002
    10-19,15,0.006
    20-29,25,0.03
    30-39,35,0.08
    40-49,45,0.15
    50-59,55,0.6
    60-69,65,2.2
    70-79,75,5.1
    >=80,85,9.3")
    covid19$disease = "COVID-19"
    ```

    The plot.
    ```{r}
    df <- rbind(flu, covid19)
    ggplot(df, aes(age, CFR, color = disease)) +
    geom_line() +
    scale_y_log10(
    name = "Case Fatality Rate"
    )
    ```