From f4d6942ea8f27bbbd24ce808f53cb9a4ea4388dd Mon Sep 17 00:00:00 2001 From: Andree Valle Campos Date: Tue, 19 Mar 2024 18:46:11 +0000 Subject: [PATCH] relocate callout to differentiate aggregated data --- episodes/severity-static.Rmd | 38 ++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/episodes/severity-static.Rmd b/episodes/severity-static.Rmd index 487ea835..0cc4cc5f 100644 --- a/episodes/severity-static.Rmd +++ b/episodes/severity-static.Rmd @@ -94,37 +94,51 @@ This calculation is _naive_ because it tends to yield a biased and mostly undere -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. -:::::::::::::::::: +### 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}