seabbs / cste-forecasting-workshop

An approachable introduction to estimating the effective reproduction number. It's meant for any and all levels of comfort with writing code

Home Page:https://samabbott.co.uk/cste-forecasting-workshop/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Welcome!

Binder

This tutorial is meant to be an approachable introduction to estimating $R_t$. It's meant for any and all levels of comfort with writing code.

This tutorial will work best if you spend a little time in advance to get set up. It can take a little time for your computer to install the necessary packages (about 15 minutes). If you've never used R before, follow the detailed instructions below for a step-by-step guide to get set up. If you have R and RStudio installed on your computer, feel free to skip ahead to the tutorial.

What is in this repository?

  • tutorial.Rmd: This is the tutorial itself. It is written in Rmarkdown and can be opened in RStudio. It contains all the code and explanations for the tutorial.
  • tutorial.html: This is the tutorial in html format. It is best viewed in a browser. For most users this is the best place to start.
  • slides.pdf: These are the slides from the workshop. They can be used alongside the tutorial to provide a little more context.
  • All the rest: These are the files that are necessary to run the tutorial. You don't need to worry about them unless you want to explore the code in more detail.

Getting set up

Local set up

The set up process comes in three parts:

  1. Downloading the folder with the necessary code onto your machine. If this document is sitting in your computer in a folder called cste-forecasting-workshop, then you've successfully completed this step. If not, look for a file with a *.zip extension in an email. Download and unzip the folder.

    • If you're comfortable with Git and Github, you can clone the repository from seabbs/cste-forecasting-workshop
  2. Download and install R and Rstudio from this website

  3. Double click on the cste-forecasting-workshop.Rproj object in the cste-forecasting-workshop folder to open the R project associated with this tutorial. This should launch R and RStudio. Then, type renv::restore(prompt = FALSE) into the open console (with the > symbol) to download all the necessary packages.

These steps should take around 20 minutes. Once completed, you're all set up to run the code in tutorial.Rmd as part of the workshop.

Using the cloud

We recommend that you run the code on your own machine. However, if you are unable to do this, there are a few other options.

One option is to use codespaces for which we provide a prebuilt environment (for vscode users this is also available for local use).

Another option is to use binder which we have set up with all the necessary packages installed. This will take a little while to load and is a little unstable but should allow you to run the code in tutorial.Rmd as part of the workshop. Note that this will not save any changes you make to the code and may be slower than running the code on your own machine. If you run into an SSL error you could try editing the address in your URL bar to http (from https) and change your browser security settings for this site. Note: do this at your own risk, and never on a state or federal government computer.

Other resources

If you are interested in finding additional resources for estimating the effective reproduction number or learning about nowcasting in R, explore the following:

EpiNow2 resources

  • Documentation: The documentation for the EpiNow2 package. This is the package we will be using in this tutorial. It is designed to be easy to use, robust to a wide range of contexts, and flexible.
  • CDC Mpox Technical reports: For a recent example of EpiNow2 in use, see the CDC's technical reports on Mpox. These reports use EpiNow2 to estimate the effective reproduction number and forecast future cases.
  • Reflections on two years estimating the effective reproduction number: This blog post reflects on the development of EpiNow2 and the challenges of estimating the effective reproduction number in real-time at scale.
  • Nowcasting example: This is a repository that uses simulated data to demonstrate how to nowcast using both EpiNow2 and epinowcast.
  • Description of the first global outbreak of mpox: an analysis of global surveillance data: A global description of the 2022–23 multi-country mpox outbreak. This paper uses EpiNow2 to estimate the effective reproduction number with adjustments for known delays and right truncation.
  • Tutorial Q and A: If you have any questions about the tutorial, please post them here. We will try to answer them as quickly as possible.

Other packages

  • epinowcast: This package has been designed as the successor to EpiNow2 and is currently under development. It is designed to be more general and even more flexible than EpiNow2.
  • epidemia: This is another flexible package for estimating the effective reproduction number and forecasting. It is designed to be more flexible than EpiNow2 and epinowcast but is potentially more difficult to use. It also generally has less functionality for dealing with delays than EpiNow2 and epinowcast.
  • EpiEstim: This is a more mature package for estimating the effective reproduction number. It exploits a mathematically relationship to fit the renewal equation very quickly but is not currently able to handle reporting delays or to produce forecasts without the use of supporting packages.

Papers

About

An approachable introduction to estimating the effective reproduction number. It's meant for any and all levels of comfort with writing code

https://samabbott.co.uk/cste-forecasting-workshop/

License:MIT License


Languages

Language:R 93.9%Language:HTML 5.1%Language:Dockerfile 1.0%