README.md

epichannel

DOI Lifecycle:
experimental CRAN
status

The goal of epichannel is to create classical endemic channel for Epidemiological Surveillance in Public Health.

Installation

if(!require("devtools")) install.packages("devtools")
devtools::install_github("avallecam/epichannel")

Example

This is a basic example which shows you how to solve a common problem:

library(epichannel)
## basic example code
library(tidyverse)

# disease dataset
denv <-
  readr::read_csv("https://dengueforecasting.noaa.gov/Training/Iquitos_Training_Data.csv") %>%
  mutate(year = lubridate::year(week_start_date),
         epiweek = lubridate::epiweek(week_start_date)) %>%
  mutate(adm="iquitos") %>%
  # cases per season - replace wiht a dummy year
  mutate(year = str_replace(season,"(.+)/(.+)","\\1") %>% as.double())

denv %>% glimpse()
#> Rows: 468
#> Columns: 12
#> $ season               <chr> "2000/2001", "2000/2001", "2000/2001", "2...
#> $ season_week          <dbl> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13...
#> $ week_start_date      <date> 2000-07-01, 2000-07-08, 2000-07-15, 2000...
#> $ denv1_cases          <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
#> $ denv2_cases          <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
#> $ denv3_cases          <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
#> $ denv4_cases          <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
#> $ other_positive_cases <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,...
#> $ total_cases          <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,...
#> $ year                 <dbl> 2000, 2000, 2000, 2000, 2000, 2000, 2000,...
#> $ epiweek              <dbl> 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 3...
#> $ adm                  <chr> "iquitos", "iquitos", "iquitos", "iquitos...

# population dataset
popdb <-
  readr::read_csv("https://dengueforecasting.noaa.gov/PopulationData/Iquitos_Population_Data.csv") %>%
  janitor::clean_names() %>%
  mutate(adm="iquitos")

popdb %>% glimpse()
#> Rows: 15
#> Columns: 3
#> $ year                 <dbl> 2000, 2001, 2002, 2003, 2004, 2005, 2006,...
#> $ estimated_population <dbl> 386666, 393355, 399770, 405988, 412095, 4...
#> $ adm                  <chr> "iquitos", "iquitos", "iquitos", "iquitos...
epi_adapted <-
  epi_adapt_timeserie(db_disease = denv,
                      db_population = popdb,
                      var_admx = adm, # common in denv and popdb
                      var_year = year, # common in denv and popdb
                      var_week = season_week, # only in denv
                      # var_year = year, 
                      # var_week = epiweek,
                      var_event_count = total_cases, # only in denv
                      var_population = estimated_population) # only in popdb
#> Joining, by = c("var_admx", "var_year")
disease_now <- epi_adapted %>%
  filter(var_year==max(var_year))

disease_pre <- epi_adapted %>%
  filter(var_year!=max(var_year))
disease_channel <-
  epi_create_channel(time_serie = disease_pre,
                     disease_name = "denv",
                     method = "gmean_1sd")
#> Joining, by = "var_admx"

disease_channel
#> # A tibble: 52 x 6
#>    var_admx var_week median  low_95 upp_95 key  
#>    <fct>       <dbl>  <dbl>   <dbl>  <dbl> <chr>
#>  1 iquitos         1   2.80  0.267    6.80 denv 
#>  2 iquitos         2   2.64  0.484    5.82 denv 
#>  3 iquitos         3   2.78  0.259    6.75 denv 
#>  4 iquitos         4   2.86  0.424    6.62 denv 
#>  5 iquitos         5   2.72  0.454    6.12 denv 
#>  6 iquitos         6   2.25  0.127    5.44 denv 
#>  7 iquitos         7   2.22  0.0474   5.52 denv 
#>  8 iquitos         8   2.34  0.167    5.61 denv 
#>  9 iquitos         9   1.82 -0.420    5.44 denv 
#> 10 iquitos        10   2.66 -0.513    8.65 denv 
#> # ... with 42 more rows
epi_join_channel(disease_channel = disease_channel,
                 disease_now = disease_now) %>%
  # ggplot
  epi_plot_channel() +
  labs(title = "Dengue virus Endemic Channel. Iquitos, Peru 2008/2009",
       caption = "Source: https://dengueforecasting.noaa.gov/",
       # x = "epiweeks",
       x = "Seasonal week",
       y = "Number of cases") +
  theme_bw()
#> Joining, by = c("var_admx", "var_week")

Contribute

Feel free to fill an issue with a reprex or implement new methods through a pull request. Here are some alternatives:

More

For a more advanced approach into surveillance algorithms refer to the surveillance R package and associated publications:

References

Bortman, Marcelo. 1999. “Elaboración de Corredores O Canales Endémicos Mediante Planillas de cálculo.” *Revista Panamericana de Salud Pública* 5: 1–8. .
Bowman, Gustavo S. AND Coelho, Leigh R. AND Tejeda. 2016. “Alarm Variables for Dengue Outbreaks: A Multi-Centre Study in Asia and Latin America.” *PLOS ONE* 11 (6): 1–23. .
Hernández, Mauricio, Diana Arboleda, Stephania Arce, Allan Benavides, Paola Andrea Tejada, Sindy Vanessa Ramírez, and Ángela Cubides. 2016. “Metodología Para La Elaboración de Canales Endémicos Y Tendencia de La Notificación Del Dengue, Valle Del Cauca, Colombia, 2009-2013.” *Biomédica* 36 (Sup2): 98–107. .
Höhle, Michael. 2007. *Computational Statistics* 22 (4): 571–82. .
Meyer, Sebastian, Leonhard Held, and Michael Höhle. 2017. “Spatio-Temporal Analysis of Epidemic Phenomena Using the R Package surveillance.” *Journal of Statistical Software* 77 (11): 1–55. .
Orellano, Pablo Wenceslao, and Julieta Itatı́ Reynoso. 2011. “Nuevo Método Para Elaborar Corredores Endémicos.” *Revista Panamericana de Salud Pública* 29: 309–14. .
Salmon, Maëlle, Dirk Schumacher, Hendrik Burmann, Christina Frank, Hermann Claus, and Michael Höhle. 2016. “A System for Automated Outbreak Detection of Communicable Diseases in Germany.” *Eurosurveillance* 21 (13). .
Salmon, Maëlle, Dirk Schumacher, and Michael Höhle. 2016. “Monitoring Count Time Series in R: Aberration Detection in Public Health Surveillance.” *Journal of Statistical Software* 70 (10): 1–35. .


avallecam/epichannel documentation built on Dec. 26, 2020, 10 p.m.