Skip to content

Commit

Permalink
Automatic readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 10, 2023
1 parent 339cef1 commit 3d06843
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<!-- badges: start -->

[![License:
MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/license/mit)
MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/license/mit/)
[![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/cfr/branch/main/graph/badge.svg)](https://app.codecov.io/gh/epiverse-trace/cfr?branch=main)
Expand Down Expand Up @@ -40,6 +40,12 @@ at the London School of Hygiene and Tropical Medicine as part of the

## Installation

*cfr* can be installed from CRAN using

``` r
install.packages("cfr")
```

The current development version of *cfr* can be installed from
[GitHub](https://github.com/) using the `pak` package.

Expand Down Expand Up @@ -87,20 +93,18 @@ as more data on cases and deaths over time becomes available, using the
function `cfr_rolling()`. Because there is a delay from onset-to-death,
a simple “naive” calculation that just divides deaths-to-date by
cases-to-date will underestimate severity. The `cfr_rolling()` function
uses the `cfr_severity()` adjustment to account for delays, and instead
compares deaths-to-date with cases-with-known-outcome-to-date. The
adjusted estimate converges to the naive estimate as the outbreak
declines and a larger proportion of cases have known outcomes.
uses the `estimate_severity()` adjustment internally to account for
delays, and instead compares deaths-to-date with
cases-with-known-outcome-to-date. The adjusted estimate converges to the
naive estimate as the outbreak declines and a larger proportion of cases
have known outcomes.

``` r
# Calculate the CFR without correcting for delays on each day of the outbreak
rolling_cfr_naive <- cfr_rolling(
data = ebola1976
)

# add the date from the outbreak
rolling_cfr_naive <- cbind(date = ebola1976[, "date"], rolling_cfr_naive)

# see the first few rows
head(rolling_cfr_naive)
#> date severity_mean severity_low severity_high
Expand All @@ -117,15 +121,9 @@ rolling_cfr_corrected <- cfr_rolling(
delay_density = function(x) dgamma(x, shape = 2.40, scale = 3.33)
)

# add the date from the outbreak
rolling_cfr_corrected <- cbind(
date = ebola1976[, "date"],
rolling_cfr_corrected
)

head(rolling_cfr_corrected)
#> date severity_mean severity_low severity_high
#> 1 1976-08-25 0.001 NA NA
#> 1 1976-08-25 NA NA NA
#> 2 1976-08-26 0.001 0.001 0.999
#> 3 1976-08-27 0.001 0.001 0.999
#> 4 1976-08-28 0.001 0.001 0.999
Expand Down
Binary file modified man/figures/README-unnamed-chunk-2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3d06843

Please sign in to comment.