Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Suggests:
distcrete,
distributional,
dplyr,
epiparameter,
forcats,
ggplot2,
incidence2,
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# cfr (development version)

* Added examples using _epiparameter_ to the `delay_distributions.Rmd` vignette. _epiparameter_ is added as a suggested dependency (#191, @joshwlambert).

# cfr 0.2.0

## New features
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,6 @@ _cfr_ functionality overlaps with that of some other packages, including
- [_coarseDataTools_](https://cran.r-project.org/package=coarseDataTools) is an R package that allows estimation of relative case fatality risk between covariate groups while accounting for delays due to survival time, when numbers of deaths and recoveries over time are known. _cfr_ uses simpler methods from @nishiura2009 that can be applied when only cases and deaths over time are known, generating estimates based on all data to date, as well as time-varying estimates. _cfr_ can also convert estimates of cases with known outcomes over time into an estimate of under-ascertainment, if a baseline estimate of fatality risk is available from the literature (e.g. from past outbreaks).
- [_EpiNow2_](https://cran.r-project.org/package=EpiNow2) is an R package that can allow estimation of case fatality risk if it is defined as a secondary observation of cases. In particular, it allows for estimation that accounts for the smooth underlying epidemic process, but this requires additional computational effort. A comparison of these methods is planned for a future release.

_cfr_ is in future expected to benefit from the functionality of the forthcoming [_epiparameter_ package](https://epiverse-trace.github.io/epiparameter/), which is also developed by Epiverse-TRACE. _epiparameter_ aims to provide a library of epidemiological parameters to parameterise delay density functions, as well as the convenient `<epiparameter>` class to store, access, and pass these parameters for delay correction.
_cfr_ benefits from the functionality of the [_epiparameter_ package](https://epiverse-trace.github.io/epiparameter/), which is also developed by Epiverse-TRACE. _epiparameter_ aims to provide a library of epidemiological parameters to parameterise delay density functions, as well as the convenient `<epiparameter>` class to store, access, and pass these parameters for delay correction.

## References
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,7 @@ By contributing to this project, you agree to abide by its terms.
process, but this requires additional computational effort. A
comparison of these methods is planned for a future release.

*cfr* is in future expected to benefit from the functionality of the
forthcoming [*epiparameter*
*cfr* benefits from the functionality of the [*epiparameter*
package](https://epiverse-trace.github.io/epiparameter/), which is also
developed by Epiverse-TRACE. *epiparameter* aims to provide a library of
epidemiological parameters to parameterise delay density functions, as
Expand Down
Binary file modified man/figures/README-fig-rolling-cfr-ebola-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion vignettes/cfr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ The onset-to-death distribution is considered to be Gamma distributed, with a sh
**Note also** that we use the central estimates for each distribution parameter, and by ignoring uncertainty in these parameters the uncertainty in the resulting CFR is likely to be underestimated.
:::

The forthcoming [_epiparameter_ package](https://epiverse-trace.github.io/epiparameter/) aims to be a library of epidemiological delay distributions, which can be accessed easily from within workflows.
The [_epiparameter_ package](https://epiverse-trace.github.io/epiparameter/) aims to be a library of epidemiological delay distributions, which can be accessed easily from within workflows.
See the [vignette on using delay distributions](delay_distributions.html) for more information on how to use this and other distribution objects supported by R to prepare delay density functions.

## Estimate disease severity
Expand Down
32 changes: 26 additions & 6 deletions vignettes/delay_distributions.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,36 @@ Further, _cfr_ functions tally estimated death counts (calculated by convolving

While users can pass functions from _stats_, and can manage distribution parameters using specialised packages and classes, it may be convenient to be able to access parameters reported in the epidemiological literature from a curated library.

The forthcoming [_epiparameter_ package](https://epiverse-trace.github.io/epiparameter/) aims to be such a library of epidemiological delay distributions.
The [_epiparameter_ package](https://epiverse-trace.github.io/epiparameter/) aims to be such a library of epidemiological delay distributions.
The dedicated `<epiparameter>` class is expected to have similar functionality to other distribution classes, allowing easy definition of density functions that can be passed to _cfr_.

The pseudo-code below shows how this might work.
Here is an example of how this works:

```r
# NOTE: this is pseudo-code
EPIPARAMETER_OBJECT <- ACCESS_DISTRIBUTION(disease, study)
```{r}
ebola_onset_to_death <- epiparameter::epiparameter_db(
disease = "Ebola",
epi_name = "onset-to-death",
single_epiparameter = TRUE
)

cfr_static(data = ebola1976, delay_density = function(x) {
density(ebola_onset_to_death, at = x)
}
)
```

This works with other functions that have the `delay_density` argument.

Another way to use `<epiparameter>` objects with _cfr_ is to convert them into a function and pass that to the `cfr_*()` function:

```{r}
# using the same Ebola onset-to-death delay distribution as the previous example
ebola_onset_to_death_func <- as.function(
ebola_onset_to_death,
func_type = "density"
)

cfr_*(data = data, delay_density = function(x) density(<EPIPARAMETER_OBJECT>, x))
cfr_static(data = ebola1976, delay_density = ebola_onset_to_death_func)
```

## References
Loading