diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 5df39f14..4e523988 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,18 +1,18 @@ -# Contributing to _datadelay_ +# Contributing to _cfr_ -This outlines how to propose a change to _datadelay_. +This outlines how to propose a change to _cfr_. ## Making changes If you want to make a change, it's a good idea to first file an issue and make sure someone from the team agrees that it’s needed. If you’ve found a bug, please file an issue that illustrates the bug with a minimal -[reprex](https://www.tidyverse.org/help/#reprex) (this will also help you write a unit test, if needed). See [bug report template](https://github.com/epiverse-trace/datadelay/issues/new?assignees=&labels=&template=bug_report.md&title=). If you have a feature request see [feature request](https://github.com/epiverse-trace/datadelay/issues/new?assignees=&labels=&template=feature_request.md&title=). +[reprex](https://www.tidyverse.org/help/#reprex) (this will also help you write a unit test, if needed). See [bug report template](https://github.com/epiverse-trace/cfr/issues/new?assignees=&labels=&template=bug_report.md&title=). If you have a feature request see [feature request](https://github.com/epiverse-trace/cfr/issues/new?assignees=&labels=&template=feature_request.md&title=). ### Pull request process -See [pull request template](https://github.com/epiverse-trace/datadelay/blob/main/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md) +See [pull request template](https://github.com/epiverse-trace/cfr/blob/main/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md) -* Fork the package and clone onto your computer. If you haven't done this before, we recommend using `usethis::create_from_github("epiverse-trace/datadelay", fork = TRUE)`. +* Fork the package and clone onto your computer. If you haven't done this before, we recommend using `usethis::create_from_github("epiverse-trace/cfr", fork = TRUE)`. * Install all development dependencies with `devtools::install_dev_deps()`, and then make sure the package passes R CMD check by running `devtools::check()`. If R CMD check doesn't pass cleanly, it's a good idea to ask for help before continuing. @@ -36,6 +36,6 @@ See [pull request template](https://github.com/epiverse-trace/datadelay/blob/mai ## Code of Conduct -Please note that the _datadelay_ project is released with a +Please note that the _cfr_ project is released with a [Contributor Code of Conduct](https://github.com/epiverse-trace/.github/blob/main/CODE_OF_CONDUCT.md). By contributing to this project you agree to abide by its terms. diff --git a/.gitignore b/.gitignore index d1faf52f..eeac99de 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ inst/doc /doc/ /Meta/ scratch.R +pkgdown/ diff --git a/DESCRIPTION b/DESCRIPTION index add0da01..2e8bb0ad 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,34 +1,54 @@ -Package: datadelay +Package: cfr Title: Estimate Disease Severity and Under-reporting Version: 0.1 Authors@R: c( + person( + given = "Pratik", + family = "Gupte", + role = c("aut", "cre", "cph"), + email = "pratik.gupte@lshtm.ac.uk", + comment = c(ORCID = "0000-0001-5294-7819") + ), person( given = "Adam", family = "Kucharski", email = "adam.kucharski@lshtm.ac.uk", - role = c("aut", "cre"), + role = c("aut", "cph"), comment = c(ORCID = "0000-0001-8814-9421") ), person( - given = "Tim", - family = "Russell", - email = "timothy.russell@lshtm.ac.uk", - role = c("aut"), - comment = c(ORCID = "0000-0001-5610-6080") + given = "Tim", + family = "Russell", + email = "timothy.russell@lshtm.ac.uk", + role = c("aut", "cph"), + comment = c(ORCID = "0000-0001-5610-6080") + ), + person( + given = "Joshua W.", + family = "Lambert", + role = c("rev"), + email = "joshua.lambert@lshtm.ac.uk", + comment = c(ORCID = "https://orcid.org/0000-0001-5218-3046") + ), + person( + given = "Hugo", + family = "Gruson", + role = c("rev"), + email = "hugo.gruson@data.org", + comment = c(ORCID = "https://orcid.org/0000-0002-4094-1476") ), person( - given = "Pratik", - family = "Gupte", - role = c("aut"), - email = "pratik.gupte@lshtm.ac.uk", - comment = c(ORCID = "0000-0001-5294-7819") + given = "Tim", + family = "Taylor", + role = c("rev"), + email = "tim.taylor@hiddenelephants.co.uk", + comment = c(ORCID = "https://orcid.org/0000-0002-8587-7113") ) ) Description: Estimate the severity of a disease and under-reporting of cases, as discussed in Nishiura et al. (2009) . License: MIT + file LICENSE -URL: https://github.com/epiverse-trace/datadelay, - https://epiverse-trace.github.io/datadelay/ -BugReports: https://github.com/epiverse-trace/datadelay/issues +URL: https://github.com/epiverse-trace/cfr, https://epiverse-trace.github.io/cfr/ +BugReports: https://github.com/epiverse-trace/cfr/issues Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 7.2.3 diff --git a/R/ebola1976.R b/R/ebola1976.R index 90419faa..031bdf04 100644 --- a/R/ebola1976.R +++ b/R/ebola1976.R @@ -1,6 +1,6 @@ #' Ebola 1976 outbreak case data #' -#' An example epidemic outbreak dataset for use with the `datadelay` package. +#' An example epidemic outbreak dataset for use with the `cfr` package. #' This dataset comes from the first Ebola outbreak in Zaire in 1976 as analysed #' in Camacho et al. (2014). #' diff --git a/R/estimate_reporting.R b/R/estimate_reporting.R index bfd218bc..07c272e4 100644 --- a/R/estimate_reporting.R +++ b/R/estimate_reporting.R @@ -25,7 +25,7 @@ #' @export #' #' @examples -#' library(datadelay) +#' library(cfr) #' library(epiparameter) #' library(covidregionaldata) #' diff --git a/R/prepare_data.R b/R/prepare_data.R index 6c361c4d..404d2c93 100644 --- a/R/prepare_data.R +++ b/R/prepare_data.R @@ -48,7 +48,7 @@ prepare_data <- function(data, ...) { #' #' @export #' @return A data.frame suitable for disease severity estimation functions -#' provided in `{datadelay}`, with the columns "date", "cases", and "deaths". +#' provided in \pkg{cfr}, with the columns "date", "cases", and "deaths". #' Note that groups in `` are not retained, and cases and deaths #' are summed by date. #' The result has a continuous sequence of dates between the start and end date diff --git a/README.Rmd b/README.Rmd index 94bcfad9..7252af9a 100644 --- a/README.Rmd +++ b/README.Rmd @@ -17,7 +17,7 @@ knitr::opts_chunk$set( ) ``` -# _{{ packagename }}_: Estimating disease severity and under-reporting +# _{{ packagename }}_: Estimate disease severity and under-reporting [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) @@ -53,11 +53,11 @@ pak::pak("epiverse-trace/epiparameter") ### Overall severity of the 1976 Ebola outbreak -This example of basic usage shows how to use _{{ packagename }}_ to estimate the overall case fatality ratios from the 1976 Ebola outbreak. +This example of basic usage shows how to use _{{ packagename }}_ to estimate the overall case fatality ratios from the 1976 Ebola outbreak [@camacho2014]. ```{r example-ebola-calc} # Load package -library(datadelay) +library(cfr) # Load the Ebola 1976 data provided with the package data("ebola1976") diff --git a/README.md b/README.md index dd4fd8f6..33a0733a 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,38 @@ -# *datadelay*: Estimating disease severity and under-reporting +# *cfr*: Estimate disease severity and under-reporting [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) -[![R-CMD-check](https://github.com/epiverse-trace/datadelay/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/epiverse-trace/datadelay/actions/workflows/R-CMD-check.yaml) +[![R-CMD-check](https://github.com/epiverse-trace/cfr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/epiverse-trace/cfr/actions/workflows/R-CMD-check.yaml) [![Codecov test -coverage](https://codecov.io/gh/epiverse-trace/datadelay/branch/main/graph/badge.svg)](https://app.codecov.io/gh/epiverse-trace/datadelay?branch=main) +coverage](https://codecov.io/gh/epiverse-trace/cfr/branch/main/graph/badge.svg)](https://app.codecov.io/gh/epiverse-trace/cfr?branch=main) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) [![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip) [![CRAN -status](https://www.r-pkg.org/badges/version/datadelay)](https://CRAN.R-project.org/package=datadelay) +status](https://www.r-pkg.org/badges/version/cfr)](https://CRAN.R-project.org/package=cfr) -*datadelay* is an R package to estimate disease severity and -under-reporting in real-time, accounting for delays in epidemic -time-series. +*cfr* is an R package to estimate disease severity and under-reporting +in real-time, accounting for delays in epidemic time-series. -*datadelay* provides simple, fast methods to calculate the overall or -static case fatality ratio (CFR) of an outbreak up to a given time -point, as well as how the CFR changes over the course of the outbreak. -*datadelay* can help estimate disease under-reporting in real-time, -accounting for delays reporting the outcomes of cases. +*cfr* provides simple, fast methods to calculate the overall or static +case fatality ratio (CFR) of an outbreak up to a given time point, as +well as how the CFR changes over the course of the outbreak. *cfr* can +help estimate disease under-reporting in real-time, accounting for +delays reporting the outcomes of cases. -*datadelay* implements methods outlined in Nishiura et al. +*cfr* implements methods outlined in Nishiura et al. ([2009](#ref-nishiura2009)), and CFR estimates based on more methods are likely to be added. -*datadelay* uses the [*epiparameter* +*cfr* uses the [*epiparameter* package](https://epiverse-trace.github.io/epiparameter/) for delay-corrected CFR estimates, and both packages are developed at the [Centre for the Mathematical Modelling of Infectious @@ -43,12 +42,12 @@ at the London School of Hygiene and Tropical Medicine as part of the ## Installation -The current development version of *datadelay* can be installed from +The current development version of *cfr* can be installed from [GitHub](https://github.com/) using the `pak` package. ``` r if(!require("pak")) install.packages("pak") -pak::pak("epiverse-trace/datadelay") +pak::pak("epiverse-trace/cfr") # Also install R package {epiparameter} for epidemiological parameter values pak::pak("epiverse-trace/epiparameter") @@ -58,12 +57,13 @@ pak::pak("epiverse-trace/epiparameter") ### Overall severity of the 1976 Ebola outbreak -This example of basic usage shows how to use *datadelay* to estimate the -overall case fatality ratios from the 1976 Ebola outbreak. +This example of basic usage shows how to use *cfr* to estimate the +overall case fatality ratios from the 1976 Ebola outbreak ([Camacho et +al. 2014](#ref-camacho2014)). ``` r # Load package -library(datadelay) +library(cfr) # Load the Ebola 1976 data provided with the package data("ebola1976") @@ -162,26 +162,25 @@ estimates are shown. ## Package vignettes -More details on how to use *datadelay* can be found in the [online +More details on how to use *cfr* can be found in the [online documentation as package -vignettes](https://epiverse-trace.github.io/datadelay/), under -“Articles”. +vignettes](https://epiverse-trace.github.io/cfr/), under “Articles”. ## Help To report a bug please open an -[issue](https://github.com/epiverse-trace/datadelay/issues/new/choose). +[issue](https://github.com/epiverse-trace/cfr/issues/new/choose). ## Contribute -Contributions to *datadelay* are welcomed. Please follow the [package +Contributions to *cfr* are welcomed. Please follow the [package contributing -guide](https://github.com/epiverse-trace/datadelay/blob/main/.github/CONTRIBUTING.md). +guide](https://github.com/epiverse-trace/cfr/blob/main/.github/CONTRIBUTING.md). ## Code of conduct -Please note that the *datadelay* project is released with a [Contributor -Code of +Please note that the *cfr* project is released with a [Contributor Code +of Conduct](https://github.com/epiverse-trace/.github/blob/main/CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms. @@ -189,6 +188,15 @@ By contributing to this project, you agree to abide by its terms.
+
+ +Camacho, A., A. J. Kucharski, S. Funk, J. Breman, P. Piot, and W. J. +Edmunds. 2014. “Potential for Large Outbreaks of Ebola Virus Disease.” +*Epidemics* 9 (December): 70–78. +. + +
+
Nishiura, Hiroshi, Don Klinkenberg, Mick Roberts, and Johan A. P. diff --git a/_pkgdown.yml b/_pkgdown.yml index 3fa48ee8..cdc17a36 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,3 +1,3 @@ -url: https://epiverse-trace.github.io/datadelay/ +url: https://epiverse-trace.github.io/cfr/ template: package: epiversetheme diff --git a/data-raw/ebola1976.R b/data-raw/ebola1976.R index 5a5a9e77..e3186b8e 100644 --- a/data-raw/ebola1976.R +++ b/data-raw/ebola1976.R @@ -3,7 +3,7 @@ ebola1976 <- read.csv( system.file( "extdata", "ebola_1976.csv", - package = "datadelay", + package = "cfr", mustWork = TRUE ) ) diff --git a/inst/WORDLIST b/inst/WORDLIST index 44cd020b..7f3d20a7 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -1,4 +1,4 @@ -CFR +Breman CFRs CMD COVID @@ -13,6 +13,7 @@ Klinkenberg Lifecycle Nishiura PLOS +Piot Poisson Tidyverse WIP @@ -26,6 +27,7 @@ dplyr ebola ebolavirus epiday +epidem epiparameter epiweek etc diff --git a/man/ebola1976.Rd b/man/ebola1976.Rd index 9c417ccf..dd9938ac 100644 --- a/man/ebola1976.Rd +++ b/man/ebola1976.Rd @@ -22,7 +22,7 @@ A data frame with 73 rows and 60 columns: ebola1976 } \description{ -An example epidemic outbreak dataset for use with the \code{datadelay} package. +An example epidemic outbreak dataset for use with the \code{cfr} package. This dataset comes from the first Ebola outbreak in Zaire in 1976 as analysed in Camacho et al. (2014). } diff --git a/man/estimate_reporting.Rd b/man/estimate_reporting.Rd index 5b8deb4b..c2676d8e 100644 --- a/man/estimate_reporting.Rd +++ b/man/estimate_reporting.Rd @@ -87,7 +87,7 @@ ascertainment estimate is calculated as the ratio of the baseline severity estimate and the delay-adjusted severity estimate } \examples{ -library(datadelay) +library(cfr) library(epiparameter) library(covidregionaldata) diff --git a/man/figures/logo.svg b/man/figures/logo.svg new file mode 100644 index 00000000..56659ed3 --- /dev/null +++ b/man/figures/logo.svg @@ -0,0 +1,8702 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +cfr diff --git a/man/prepare_data.incidence2.Rd b/man/prepare_data.incidence2.Rd index 6d1d1b36..5de2c8dd 100644 --- a/man/prepare_data.incidence2.Rd +++ b/man/prepare_data.incidence2.Rd @@ -30,7 +30,7 @@ data.} } \value{ A data.frame suitable for disease severity estimation functions -provided in \code{{datadelay}}, with the columns "date", "cases", and "deaths". +provided in \code{{cfr}}, with the columns "date", "cases", and "deaths". Note that groups in \verb{} are not retained, and cases and deaths are summed by date. The result has a continuous sequence of dates between the start and end date diff --git a/tests/testthat.R b/tests/testthat.R index 4f8ffa4e..37e13eb5 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -8,7 +8,7 @@ # nolint start library(testthat) -library(datadelay) +library(cfr) # nolint end -test_check("datadelay") +test_check("cfr") diff --git a/vignettes/datadelay.Rmd b/vignettes/cfr.Rmd similarity index 93% rename from vignettes/datadelay.Rmd rename to vignettes/cfr.Rmd index 42f17430..d077f9f2 100644 --- a/vignettes/datadelay.Rmd +++ b/vignettes/cfr.Rmd @@ -17,7 +17,7 @@ vignette: > It is important to understand the severity of a disease in terms of the case fatality rate in order to respond appropriately to an outbreak. During an outbreak there is often a delay between cases being reported, and the outcomes of those cases being known. Knowing the distribution of these delays from previous outbreaks of the same (or similar) diseases, and accounting for them, can be useful in getting better estimates of disease severity. -The severity of a disease can be estimated while correcting for delays in reporting using methods outlines in @nishiura2009, and which are implemented in the _datadelay_ package. +The severity of a disease can be estimated while correcting for delays in reporting using methods outlines in @nishiura2009, and which are implemented in the _cfr_ package. ::: {.alert .alert-primary} ## Use case {-} @@ -44,8 +44,8 @@ knitr::opts_chunk$set( ``` ```{r setup} -# load datadelay -library(datadelay) +# load cfr +library(cfr) ``` ## Case and death data @@ -54,10 +54,10 @@ Data on cases and deaths may be obtained from a number of publicly accessible so In an outbreak response scenario, such data may also be compiled and shared locally. -The _datadelay_ package requires only a data frame with three columns, "date", "cases", and "deaths", giving the daily number of reported cases and deaths. +The _cfr_ package requires only a data frame with three columns, "date", "cases", and "deaths", giving the daily number of reported cases and deaths. ::: {.alert .alert-warning} -Datasets with columns that contain this information under different names can be handled by common data science tools, such as [packages in the Tidyverse](https://www.tidyverse.org/), to prepare data for _datadelay_. +Datasets with columns that contain this information under different names can be handled by common data science tools, such as [packages in the Tidyverse](https://www.tidyverse.org/), to prepare data for _cfr_. See examples of this in the [vignette on obtaining a static severity estimate](estimate_static_severity.html). ::: @@ -89,7 +89,7 @@ onset_to_death_ebola <- epidist_db( onset_to_death_ebola ``` -This `` object can be passed to the functions in _datadelay_ to help correct for reporting delays. +This `` object can be passed to the functions in _cfr_ to help correct for reporting delays. ## Estimate disease severity diff --git a/vignettes/data_from_incidence2.Rmd b/vignettes/data_from_incidence2.Rmd index aea90d91..298bf5ed 100644 --- a/vignettes/data_from_incidence2.Rmd +++ b/vignettes/data_from_incidence2.Rmd @@ -12,9 +12,9 @@ vignette: > %\VignetteEncoding{UTF-8} --- -This vignette shows how to prepare `` objects from the [_incidence2_ package](https://www.reconverse.org/incidence2/) for use with _datadelay_, using the `prepare_data()` method for the `` class. +This vignette shows how to prepare `` objects from the [_incidence2_ package](https://www.reconverse.org/incidence2/) for use with _cfr_, using the `prepare_data()` method for the `` class. -We first load the libraries we require, including _datadelay_, _incidence2_, [_outbreaks_](https://www.reconverse.org/outbreaks/) for linelist data from a simulated ebola outbreak, and [_epiparameter_](https://epiverse-trace.github.io/epiparameter/) for delay distribution data. +We first load the libraries we require, including _cfr_, _incidence2_, [_outbreaks_](https://www.reconverse.org/outbreaks/) for linelist data from a simulated ebola outbreak, and [_epiparameter_](https://epiverse-trace.github.io/epiparameter/) for delay distribution data. ```{r, include = FALSE} knitr::opts_chunk$set( @@ -24,7 +24,7 @@ knitr::opts_chunk$set( ``` ```{r setup} -library(datadelay) +library(cfr) # load {incidence2} library(incidence2) @@ -113,11 +113,11 @@ estimate_static( ## `` objects from aggregated case data -Aggregated case data such as that provided by the package [_covidregionaldata_](https://epiforecasts.io/covidregionaldata/) can be used with _datadelay_ directly. +Aggregated case data such as that provided by the package [_covidregionaldata_](https://epiforecasts.io/covidregionaldata/) can be used with _cfr_ directly. Such usage is shown in other vignettes such as the [vignette on estimating time-varying severity](estimate_time_varying_severity.html). -Here we show how to transform such data into `` objects, and then prepare them for _datadelay_. +Here we show how to transform such data into `` objects, and then prepare them for _cfr_. The columns in this dataset are already in a format that can be converted into an `` object using `incidence2::incidence()`, and then handled by `prepare_data()`. The code chunks below show how this is to be done. diff --git a/vignettes/estimate_ascertainment.Rmd b/vignettes/estimate_ascertainment.Rmd index 1eb19310..cf115f8a 100644 --- a/vignettes/estimate_ascertainment.Rmd +++ b/vignettes/estimate_ascertainment.Rmd @@ -29,13 +29,13 @@ knitr::opts_chunk$set( # Overview -This vignette outlines the function within _datadelay_ used to estimate the +This vignette outlines the function within _cfr_ used to estimate the proportion of cases, infections or hospitalisations ascertained. First, we load the key packages required for this vignette: ```{r, message = FALSE, warning=FALSE, eval = TRUE} -library(datadelay) +library(cfr) library(epiparameter) library(covidregionaldata) ``` @@ -76,7 +76,7 @@ within this vignette, as it illustrates the use for this analysis pipeline well. ## Data required The data required to estimate how the severity of a disease changes over time -using the _datadelay_ package includes: +using the _cfr_ package includes: * A time-series of cases, hospitalisations or some other proxy for infections over time; @@ -96,7 +96,7 @@ here comes from the _epiparameter_ package. ## Estimating the proportion of cases or infections that have been ascertained -The function `estimate_reporting()` from the _datadelay_ package estimates the +The function `estimate_reporting()` from the _cfr_ package estimates the proportion of cases, infections, hospitalisations --- or whichever proxy for infections is provide --- which have been ascertained. The method used within this function extends the methods outlined in the previous vignettes about @@ -111,7 +111,7 @@ severity estimates can be calculated using either the `estimate_static()` or the # Example with data from the ongoing COVID-19 pandemic in the U.K. -We outline how the time-varying severity estimation works in *datadelay* using +We outline how the time-varying severity estimation works in *cfr* using a number of examples. The data for all of the examples is from the ongoing COVID-19 epidemic. Firstly, we analyse the U.K. data, then we pick three other countries with large outbreaks to analyse. @@ -206,7 +206,7 @@ plot(onset_to_death_covid, day_range = seq_len(30)) ## Estimating the proportion of cases that have been ascertained -We use the `estimate_reporting()` function within the _datadelay_ package to +We use the `estimate_reporting()` function within the _cfr_ package to calculate the time-varying CFR for the COVID-19 epidemic in the U.K: ```{r } diff --git a/vignettes/estimate_static_severity.Rmd b/vignettes/estimate_static_severity.Rmd index ad4dde94..c4f2b6ec 100644 --- a/vignettes/estimate_static_severity.Rmd +++ b/vignettes/estimate_static_severity.Rmd @@ -29,7 +29,7 @@ knitr::opts_chunk$set( # Overview -This vignette outlines how to use _datadelay_ to calculate disease severity +This vignette outlines how to use _cfr_ to calculate disease severity during an ongoing outbreak. We wish to estimate one of the typical severity quantities used in epidemiology: the *case fatality risk (CFR)*, *infection hospitality risk (IFR)* or *hospitalisation fatality risk (HFR)*. We @@ -38,7 +38,7 @@ hospitalisations (respectively) and deaths with an appropriate delay distribution. The methods used here originate from @nishiura2009. This vignette demonstrates how to implement the core functions within -_datadelay_. Specifically, we will cover +_cfr_. Specifically, we will cover 1. Why naive estimates of CFR or HFR generated during an ongoing outbreak require adjusting, given out of sync time series are often being compared. @@ -55,7 +55,7 @@ along with a confidence interval. Now we load the three packages we need using the following commands: ```{r, message = FALSE, warning=FALSE, eval = TRUE} -library(datadelay) +library(cfr) library(epiparameter) library(covidregionaldata) library(dplyr) @@ -94,7 +94,7 @@ is essential for accurate estimates of severity. ## Data required The data required to estimate the severity of a disease during an ongoing -outbreak using the _datadelay_ package includes: +outbreak using the _cfr_ package includes: * A time-series of cases, hospitalisations or some other proxy for infections over time; @@ -108,7 +108,7 @@ In practice, the time-series of cases and deaths will already be together, given that they usually originate from sources that will have typically collated them into a single data file. -The function within _datadelay_ used to estimate the severity of a disease at a +The function within _cfr_ used to estimate the severity of a disease at a single time-point — `estimate_static()` — requires a `data.frame` of input data --- typically case and death time series data --- and a delay distribution. The delay distribution we use here comes from the _epiparameter_ package. @@ -175,7 +175,7 @@ data("ebola1976") Then, we plot the case incidence data with the following command: -```{r fig.cap ="Incidence of cases over time, taken from the 1976 Ebola outbreak in the Democratic Republic of the Congo. Data retrieved from within the *datadelay* package.", class.source = 'fold-hide'} +```{r fig.cap ="Incidence of cases over time, taken from the 1976 Ebola outbreak in the Democratic Republic of the Congo. Data retrieved from within the *cfr* package.", class.source = 'fold-hide'} ggplot(ebola1976) + geom_step( aes( @@ -241,7 +241,7 @@ plot(onset_to_death_ebola, day_range = seq_len(30), vb = FALSE) ## Estimating incidence of cases (or similar time-series) with a known outcome -The function `known_outcomes()` from the _datadelay_ package estimates the +The function `known_outcomes()` from the _cfr_ package estimates the number of cases which have a known outcome over time. The resulting data frame contains two new columns, "known_outcomes", for the number of known outcomes (deaths) expected for each day, and "u_t", the under-reporting factor that estimates what proportion of cases have not been reported, given the estimated number of known outcomes. @@ -296,7 +296,7 @@ ggplot(df_known_outcomes_ebola) + Once we calculate the proportion of cases with known outcomes, we apply the proportion to the number of cases to correct for the delay between onset-to-death. We do so by using the function `estimate_static()` from the -_datadelay_ package. This function estimates the proportion of known outcomes +_cfr_ package. This function estimates the proportion of known outcomes over time, and uses the estimate to correct the naive severity estimate. This is controlled using the `correct_for_delays` boolean flag argument in the `estimate_static()` function. Otherwise, it calculates a naive severity estimate, @@ -332,7 +332,7 @@ COVID-19 outbreak in the U.K. We do so, as the CFR changed dramatically as a result of the vaccine campaign. The static severity calculations we are performing in this vignette are not able to deal with changes in severity over time. We download the data --- using the `covidregionaldata` package --- -change some default column names to match those required by _datadelay_ and +change some default column names to match those required by _cfr_ and subset the data.frame to focus on the first year of the pandemic in the U.K., with the following commands: diff --git a/vignettes/estimate_time_varying_severity.Rmd b/vignettes/estimate_time_varying_severity.Rmd index 6c133119..df067415 100644 --- a/vignettes/estimate_time_varying_severity.Rmd +++ b/vignettes/estimate_time_varying_severity.Rmd @@ -29,7 +29,7 @@ knitr::opts_chunk$set( # Overview -This vignette outlines how to use _datadelay_ to estimate how the severity of a +This vignette outlines how to use _cfr_ to estimate how the severity of a disease changes over the course of an ongoing outbreak. We wish to estimate how common severity quantities change over time: the *case fatality risk (CFR)*, *infection hospitality risk (IFR)* or @@ -42,7 +42,7 @@ distribution. The methods used here are documented in @nishiura2009. First, we load the five essential packages needed for this vignette: ```{r, message = FALSE, warning=FALSE, eval = TRUE} -library(datadelay) +library(cfr) library(epiparameter) library(covidregionaldata) ``` @@ -82,7 +82,7 @@ approach is to use the function demonstrated in this vignette: ## Data required The data required to estimate how the severity of a disease changes over time -using the _datadelay_ package includes: +using the _cfr_ package includes: * A time-series of cases, hospitalisations or some other proxy for infections over time; @@ -102,7 +102,7 @@ here comes from the _epiparameter_ package. ## Adjusting for delays between the two time series -The function `estimate_time_varying()` from the _datadelay_ package estimates +The function `estimate_time_varying()` from the _cfr_ package estimates the number of cases which have a known outcome over time. The method used within this function follows @nishiura2009. The function calculates a quantity $k_t$ for each day within the input data, @@ -144,7 +144,7 @@ Hospitalisation Fatality Risk (HFR) estimate. # Changing severity of the COVID-19 pandemic in the U.K. -We outline how the time-varying severity estimation works in *datadelay* using a +We outline how the time-varying severity estimation works in *cfr* using a number of examples. The data for all of the examples is from the ongoing COVID-19 epidemic. Firstly, we analyse the U.K. data, then we pick three other countries with large outbreaks to analyse. @@ -240,7 +240,7 @@ plot(onset_to_death_covid, day_range = seq(30)) ## Estimating the naive and corrected CFR -We use the `estimate_time_varying()` function within the _datadelay_ package +We use the `estimate_time_varying()` function within the _cfr_ package to calculate the time-varying CFR for the COVID-19 epidemic in the U.K: ```{r}