| load_infections_paneldata | R Documentation |
Loading infections panel data (data.frame) and creating an object of class infpan
load_infections_paneldata(
data,
col_cases,
col_date,
col_region,
other_cols = NULL,
time_format = "%Y-%m-%d",
time_unit = "days",
verbose = FALSE
)
data |
|
col_cases |
|
col_date |
|
col_region |
|
other_cols |
|
time_format |
|
time_unit |
|
verbose |
|
The function import user-given infections panel data.
The input data is checked in several ways (e.g., whether data is balanced or not).
Other relevant columns from the input data may be defined in the character vector other_cols:
"R_t" (Effective reproduction number), "Cum. cases" (Cumulative cases), "Incidence" Incidence (per xxx pop),
"Population" (Population size of the region), "Roll. mean" (Rolling mean of cases), and "Roll. sum" (Rolling sum of cases).
The output is an object of class infpan. The results can be viewed using summary(infpan).
From an instance of class infpan, all built-in analyses for infections panel data may be conducted,
e.g., the Swash-Backwash Model (swash(infpan)) or logistic growth models (growth(infpan)).
object of class infpan-class
Thomas Wieland
Wieland T (2020) Flatten the Curve! Modeling SARS-CoV-2/COVID-19 Growth in Germany at the County Level. REGION 7(2), 43–83. \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.18335/region.v7i2.324")}
Wieland T (2025) Assessing the effectiveness of non-pharmaceutical interventions in the SARS-CoV-2 pandemic: results of a natural experiment regarding Baden-Württemberg (Germany) and Switzerland in the second infection wave. Journal of Public Health 33(11), 2497-2511. \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.1007/s10389-024-02218-x")}
infpan-class
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)
CH_covidwave1 <-
swash(
infpan_CH,
verbose = TRUE
)
# Swash-Backwash Model for Swiss COVID19 cases
# Spatial aggregate: NUTS 3 (cantons)
summary(CH_covidwave1)
# Summary of Swash-Backwash Model
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.