
Process Vaccination Data for MOSAIC Model
Source:R/process_WHO_vaccination_data.R
process_WHO_vaccination_data.RdThis function processes raw vaccination data from WHO to create a clean, structured dataset for the MOSAIC model. It handles data cleaning, infers missing campaign dates, validates the dataset, and saves the output for use in modeling cholera vaccination efforts.
Value
The function saves the processed vaccination data to a CSV file in the directory specified by PATHS$MODEL_INPUT. It also returns the processed data as a data frame for further use in R.
Details
This function performs the following steps:
Load and Clean Vaccination Data: - Reads raw WHO vaccination data. - Converts country names to ISO codes for consistency. - Filters the data to include only countries in the MOSAIC database.
Infer Missing Campaign Dates: - Computes the delay between decision and campaign dates. - Infers missing campaign dates based on the mean delay where possible. - Fixes missing decision dates for grouped request numbers.
Validate and Filter Data: - Ensures all rows have valid campaign dates. - Removes rows where
doses_shippedis zero or missing.Save Processed Data: - Writes the cleaned and processed dataset to a CSV file for further modeling.
Examples
if (FALSE) { # \dontrun{
# Example usage
PATHS <- list(
DATA_SCRAPE_WHO_VACCINATION = "path/to/who/vaccination",
MODEL_INPUT = "path/to/model/input"
)
processed_data <- process_WHO_vaccination_data(PATHS)
} # }