Skip to content

Commit

Permalink
relocate callout to differentiate aggregated data
Browse files Browse the repository at this point in the history
  • Loading branch information
avallecam committed Mar 19, 2024
1 parent f368cfd commit f4d6942
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions episodes/severity-static.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -94,37 +94,51 @@ This calculation is _naive_ because it tends to yield a biased and mostly undere
<!-- add here the callout on ratio or risk? -->
<!-- https://github.com/epiverse-trace/cfr/issues/130 -->

To calculate the naive CFR, the `{cfr}` package requires a data frame with three columns named:
To calculate the naive CFR, the `{cfr}` package requires an input data frame with three columns named:

- `date`
- `cases`
- `deaths`

Let's explore the `ebola1976` dataset, which comes from the first Ebola outbreak in Zaire in 1976, as analysed by Camacho et al. (2014).

```{r}
# Load the Ebola 1976 data provided with the package
data("ebola1976")
# view top data
ebola1976 %>% as_tibble()
```

:::::::::::::::::: callout

### We need daily data
### We need aggregated incidence data

`{cfr}` reads **aggregated** incidence data. Similar to the `{EpiNow2}` with the difference that for `{cfr}` we need one more column named `deaths`.

These should give the **daily** number of reported cases and deaths.
```{r}
EpiNow2::example_confirmed %>% as_tibble()
```

We emphasise **daily** because this needs to show all the observations for all the days in the time frame of your analysis, even if the number of observations is zero or there are missing values.
This data input should be **aggregated** by day, which means one observation *per day*, containing the *daily* number of reported cases and deaths. Observations with zero or missing values should also be included, similar to a time-series data.

Also, this currently only works for **daily** data, not weekly data.
Also, `{cfr}` currently works for *daily* data only, not weekly data.

<!-- suggest ways to deal with raw input weekly data -->
<!-- https://github.com/epiverse-trace/cfr/issues/117 -->

::::::::::::::::::
### Aggregated differs from Linelist

Let's explore the `ebola1976` dataset, which comes from the first Ebola outbreak in Zaire in 1976, as analysed by Camacho et al. (2014).
Lastly, *aggregated* incidence data differs from **linelist** data, where each observation contains subject-level data.

```{r}
# Load the Ebola 1976 data provided with the package
data("ebola1976")
# view top data
ebola1976 %>% as_tibble()
outbreaks::ebola_sierraleone_2014 %>% as_tibble()
```

::::::::::::::::::



When we use `cfr_static()` to `data` only, we calculate the naive CFR:

```{r}
Expand Down

0 comments on commit f4d6942

Please sign in to comment.