Skip to content

choi-hannah/inc2prev

 
 

Repository files navigation

Estimating epidemiological quantities from prevalence and antibody estimates in the ONS Community Infection Survey

In this work, we use a semi-mechanistic method to estimating epidemiological quantities such as infection incidence, infection growth rates, reproduction numbers and immunological parameters from Office for National Statistics (ONS) prevalence and antibody positivity estimates at the national, and subnational levels, as well as across age groups. Our approach assumes that unobserved infections can be represented using an initial intercept and a Gaussian process with a logit link function. To estimate population prevalence we convolve the PCR detection curve estimated in Hellewell et al., BMC Medicine, 2021, with uncertainty assumed to be normal and independent for each day since infection

We model antibody postitivity by fitting an initial proportion of the population that have infection derived antibodies. We then fit a daily model that assumes that some fraction of new infections that are not already antibody postive become so and that a proportion of those current antibody postive become antibody negative. We include vaccination similarly and assume that some fraction of those vaccination become antibody positive and that this positivity wanes with a daily rate (independent from the waning rate of those antibody positive from infection). This estimate of population level antibody positivity is then averaged across the time windows of the available antibody positivity estimates with again a normal observation model being assumed with the standard error made up of the ONS estimated standard error and a shared standard error term estimated in the model.

The model is implemented in stan using cmdstanr.

Citation

Abbott, Sam, and Sebastian Funk. 2022. Estimating Epidemiological Quantities from Repeated Cross-Sectional Prevalence Measurements. medRxiv. https://doi.org/10.1101/2022.03.29.22273101.

Preprint

Working paper: as html, or pdf

Real-time estimates

The latest estimates are available in a real-time report.

The code in this repository can be used to reproduce the results, and create the figures Estimates are also available as data tables (labelled estimates_{level}.csv).

Example estimates from England

We ONS estimates for prevalence and antibody positivity in England to estimate infections and transmission parameters. The code to reproduce these results can be found here

Figure 1: ONS prevalence estimates compared to model estimates of ONS prevalence combined with model estimates of population prevalence.

Figure 2: ONS antibody positivity estimates compared to model estimates of ONS antibody positivity combined with model estimates of population antibody positivity.

Figure 3: Daily infection incidence estimates

Figure 4: Infection growth rate estimates

Figure 5: Effective reproduction rate rate estimates

Fit diagnostics

Figure 6: Pairs plot of a sample of parameter posteriors

Documentation

File structure

Folder Purpose
data-raw Raw data and scripts to generate processed data.
data-processed Data processed ready for use in downstream analyses.
R R functions for preprocessing data, model fitting, and model postprocessing.
scripts Scripts used to estimate models and analyse result.
stan The backend stan model code and support functions.
.devcontainer Contains the projects Dockerfile and setup instructions for using the code with vscode.

Obtaining data

The data used in this repository can be obtained using the scripts in data-raw/. In particular, PCR positivity data by nation, region, age and variant can be downloaded using

Rscript data-raw/update-cis.R

and antibody data can be downloaded using

Rscript data-raw/update-ab.R

Reproducing the estimates

Estimates provided here can be generated using the scripts/estimate.R script. Before running this, the inc2prev package contained in this repository needs to be installed, e.g. using

remotes::install_github("epiforecasts/inc2prev")

The estimates shown in the plots above were generated using

Rscript scripts/estimate.R -d 1

Dependencies

All dependencies can be installed using the following,

remotes::install_dev_deps()

Alternatively a docker container and image is provided. An easy way to make use of this is using the Remote development extension of vscode.

Installing CmdStan

If you don’t already have CmdStan installed then it is also necessary to install CmdStan usin CmdStanR’s install_cmdstan() function to enable model fitting. A suitable C++ toolchain is also required. Instructions are provided in the Getting started with CmdStanR vignette. See the CmdStanR documentation for further details and support.

cmdstanr::install_cmdstan()

License

This project uses data from the Office for National Statistics Community Infection Survey, which is licensed under the Open Government License v3.0.

About

Estimate incidence from ONS prevalence estimates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • R 72.0%
  • Stan 13.4%
  • Shell 13.0%
  • Dockerfile 1.6%