Worked Example 3 - Generating Epidemiological Data Sets
BWorkedExampleCDataGenerate.Rmd
This worked example demonstrates how to use the package to generate a set of epidemiological data (serological and/or annual reported severe/fatal cases) for specified years and regions (and age ranges, in the case of serological data).
This can be set up to either:
- Match a set of observed data supplied in appropriate formats
- Create a hypothetical set of data with no existing counterpart by matching to “dummy” data which presents dates, regions and/or age ranges in the appropriate formats
We first load the input data set, regional environmental covariate values, coefficients of environmental covariate values used to calculate spillover FOI and R0 values, and observed serological and annual case data (here generated by the model itself):
library(YEP)
input_data <- readRDS(file = paste(path.package("YEP"),
"/exdata/input_data_example.Rds", sep = ""))
enviro_data <- read.csv(file = paste(path.package("YEP"),
"/exdata/enviro_data_example.csv", sep = ""),
header = TRUE)
enviro_coeffs <- read.csv(file = paste(path.package("YEP"),
"/exdata/enviro_coeffs_example.csv",
sep = ""), header = TRUE)
# Seroprevalence data for comparison, by region, year & age group, in format
# no. samples/no. positives
obs_sero_data <- read.csv(file = paste(path.package("YEP"),
"/exdata/obs_sero_data_example.csv",
sep = ""), header = TRUE)
# Annual reported case/death data for comparison, by region and year, in format
# no. cases/no. deaths
obs_case_data <- read.csv(file = paste(path.package("YEP"),
"/exdata/obs_case_data_example.csv",
sep = ""), header = TRUE)
We calculate values of spillover FOI and R0 as described in [TBA]:
n_regions <- nrow(enviro_data)
FOI_values=R0_values=rep(NA,n_regions)
for(n_region in 1:n_regions){
FOI_R0_values <- param_calc_enviro(enviro_coeffs = enviro_coeffs[1, ],
enviro_covar_values = enviro_data[n_region,c(2:ncol(enviro_data))])
FOI_values[n_region] <- FOI_R0_values$FOI
R0_values[n_region] <- FOI_R0_values$R0
}
[TBA]
vaccine_efficacy <- 1.0
p_rep_severe <- 0.05
p_rep_death <- 0.1
mode_start <- 1
start_SEIRV <- NULL
dt <- 1.0
n_reps <- 1
deterministic <- TRUE
mode_parallel <- "none" #TBA
cluster <- NULL #TBA
[TBA]
dataset1 <- Generate_Dataset(input_data,FOI_values,R0_values,obs_sero_data,obs_case_data,vaccine_efficacy,
p_rep_severe,p_rep_death,mode_start,start_SEIRV,dt,n_reps,deterministic,mode_parallel,cluster)
[TBA]