calculate_Rt: Effective Reproduction Number

calculate_RtR Documentation

Effective Reproduction Number

Description

Calculation of the effective reproduction number for infections panel data.

Usage

calculate_Rt(
  object,
  GP = 4,
  correction = FALSE,
  col_name = NULL,
  overwrite = FALSE,
  verbose = FALSE
  )

Arguments

object

object of class infpan

GP

Generation period, in time units (typically days)

correction

Correction of values equal to zero? (Recommended)

col_name

character value specifying the column name of the computed rolling means

overwrite

bool argument which indicates whether the column should be overwritten if already existing

verbose

bool argument which indicates whether progress messages are displayed

Details

Calculates the effective reproduction number R_t for all time points for each region in the infections panel data. Set the generation period by the parameter GP (default: 4). If correction is TRUE, values equal to zero are increased by one. The method uses the built-in function R_t().

Value

infpan object including R_t column in the infections panel data

Author(s)

Thomas Wieland

References

an der Heiden M, Hamouda O (2020) Schätzung der aktuellen Entwicklung der SARS-CoV-2-Epidemie in Deutschland - Nowcasting. Epidemiologisches Bulletin 17, 10-15. \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.25646/6692")}

Bonifazi G, Lista L, Menasce D, Mezzetto M, Pedrini D, Spighi R, Zoccoli A (2021) A simplified estimate of the effective reproduction number Rt using its relation with the doubling time and application to Italian COVID-19 data. The European Physical Journal Plus 136, 386. \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.1140/epjp/s13360-021-01339-6")}

Wieland T (2020) A phenomenological approach to assessing the effectiveness of COVID-19 related nonpharmaceutical interventions in Germany. Safety Science 131, 104924. \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.1016/j.ssci.2020.104924")}

Examples

data(COVID19Cases_geoRegion)
# Get SWISS COVID19 cases at NUTS 3 level

COVID19Cases_geoRegion <- 
  COVID19Cases_geoRegion[!COVID19Cases_geoRegion$geoRegion %in% c("CH", "CHFL"),]
# Exclude CH = Switzerland total and CHFL = Switzerland and Liechtenstein total

COVID19Cases_geoRegion <- 
  COVID19Cases_geoRegion[COVID19Cases_geoRegion$datum <= "2020-05-31",]
# Extract first COVID-19 wave

infpan_CH <- load_infections_paneldata(
    data = COVID19Cases_geoRegion,
    col_cases = "entries",
    col_date = "datum",
    col_region = "geoRegion",
    other_cols = c("Population" = "pop"), 
    verbose = TRUE
  )
# Import as infections panel data set (class infpan)

infpan_CH <- calculate_Rt(
  infpan_CH,
  verbose = TRUE
  )
# Calculate effective reproduction number

summary(infpan_CH)
# Summary of infpan object

swash documentation built on April 7, 2026, 1:06 a.m.