compare_countries | R Documentation |
This function enables bootstrap estimates for the mean difference of Swash-Backwash Model parameters of two countries to be compared.
compare_countries(
sbm1,
sbm2,
country_names = c("Country 1", "Country 2"),
indicator = "R_0A",
iterations = 100,
samples_ratio = 0.8,
alpha = 0.05,
replace = TRUE
)
sbm1 |
A |
sbm2 |
A |
country_names |
|
indicator |
|
iterations |
Number of iterations for resampling (default: 100) |
samples_ratio |
Proportion of regions included in each sample (default: 0.8) |
alpha |
Significance level |
replace |
Resampling with replacement ( |
The combination of the Swash-Backwash Model and bootstrap resampling allows the estimation of mean differences of a user-specified model parameter (e.g., spatial reproduction number R_{OA}
) between two countries. This makes it possible to check whether the spatial spread velocity of a communicable disease is significantly different in one country than in another country. Since the initial data in the Swash-Backwash Model should be balanced, entity-based bootstrap sampling is carried out in the compare_countries()
function. This means that not, for example, 80% of all observations are included in each sample at a sample ratio equal to p
= 0.8, but rather all observations for 80% of the regions. For both countries, B
bootstrap samples (default: 100) are drawn for which the Swash-Backwash Model is calculated. Based on the distribution of indicators, confidence intervals are calculated at the user-specified significance level \alpha
. The compare_countries()
function calculates the differences of the user's desired indicator between the two samples, D
, and also calculates \alpha
confidence intervals for this.
object of class countries
, see countries-class
Thomas Wieland
Swash-Backwash Model:
Cliff AD, Haggett P (2006) A swash-backwash model of the single epidemic wave. Journal of Geographical Systems 8(3), 227-252. \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.1007/s10109-006-0027-8")}
Smallman-Raynor MR, Cliff AD, Stickler PJ (2022) Meningococcal Meningitis and Coal Mining in Provincial England: Geographical Perspectives on a Major Epidemic, 1929–33. Geographical Analysis 54, 197–216. \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.1111/gean.12272")}
Smallman-Raynor MR, Cliff AD, The COVID-19 Genomics UK (COG-UK) Consortium (2022) Spatial growth rate of emerging SARS-CoV-2 lineages in England, September 2020–December 2021. Epidemiology and Infection 150, e145. \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.1017/S0950268822001285")}.
Bootstrapping und bootstrap confidence intervals:
Efron B, Tibshirani RJ (1993) An Introduction to the Bootstrap.
Ramachandran KM, Tsokos CP (2021) Mathematical Statistics with Applications in R (Third Edition). Ch. 13.3.1 (Bootstrap confidence intervals). \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.1016/B978-0-12-817815-7.00013-0")}
swash
, countries-class
data(COVID19Cases_geoRegion)
# Get Swiss COVID19 cases at NUTS 3 level
data(Oesterreich_Faelle)
# Get Austrian COVID19 cases at NUTS 3 level
# (first wave, same final date as in Swiss data: 2020-05-31)
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
CH_covidwave1 <-
swash (
data = COVID19Cases_geoRegion,
col_cases = "entries",
col_date = "datum",
col_region = "geoRegion"
)
# Swash-Backwash Model for Swiss COVID19 cases
# Spatial aggregate: NUTS 3 (cantons)
AT_covidwave1 <-
swash (
data = Oesterreich_Faelle,
col_cases = "Faelle",
col_date = "Datum",
col_region = "NUTS3"
)
# Swash-Backwash Model for Austrian COVID19 cases
# Spatial aggregate: NUTS 3
AT_vs_CH <-
compare_countries(
CH_covidwave1,
AT_covidwave1,
country_names = c("Switzerland", "Austria"))
# Country comparison Switzerland vs. Austria
# default config: 100 iterations, alpha = 0.05, sample ratio = 80%,
# indicator: R_0A
summary(AT_vs_CH)
# Summary of country comparison
plot(AT_vs_CH)
# Plot of country comparison
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.