| Title: | Vaccine Coverage and Outbreak Risk Analysis |
|---|---|
| Description: | Provides tools to analyze vaccine coverage data and simulate potential disease outbreak scenarios. It allows users to calculate key epidemiological metrics such as the effective reproduction number (Re), outbreak probabilities, and expected infection counts based on county-level vaccination rates, disease characteristics, and vaccine effectiveness. The package includes historical kindergarten vaccination data for Florida counties and offers functions for generating summary tables, visualizations, and exporting the underlying plot data. |
| Authors: | Peiyu Liu [aut, cre], Matt Hitchings [ctb], Ira Longini [ctb] |
| Maintainer: | Peiyu Liu <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.1.0 |
| Built: | 2026-05-29 09:25:08 UTC |
| Source: | https://github.com/peiyuliu-biostats/vaxiner |
Calculate the expected number of infections in a cohort
calc_expected_infections(vc, disease, kindergarten_size, VE, r0_custom = NULL)calc_expected_infections(vc, disease, kindergarten_size, VE, r0_custom = NULL)
vc |
Vaccination coverage rate (proportion, 0 to 1). |
disease |
Character string: "Measles", "Pertussis", "Chickenpox", or "Custom". |
kindergarten_size |
Integer, the size of the school cohort. |
VE |
Vaccine effectiveness (proportion, 0 to 1). |
r0_custom |
The basic reproduction number (R0) for a custom disease. Required only if 'disease' is "Custom". |
The expected number of infected individuals.
calc_expected_infections(vc = 0.85, disease = "Measles", kindergarten_size = 200, VE = 0.97) calc_expected_infections( vc = 0.90, disease = "Custom", kindergarten_size = 150, VE = 0.90, r0_custom = 7 )calc_expected_infections(vc = 0.85, disease = "Measles", kindergarten_size = 200, VE = 0.97) calc_expected_infections( vc = 0.90, disease = "Custom", kindergarten_size = 150, VE = 0.90, r0_custom = 7 )
Calculate the effective reproduction number (Re)
calc_re(vc, disease, VE, r0_custom = NULL)calc_re(vc, disease, VE, r0_custom = NULL)
vc |
Vaccination coverage rate (proportion, 0 to 1). |
disease |
Character string: "Measles", "Pertussis", "Chickenpox", or "Custom". |
VE |
Vaccine effectiveness (proportion, 0 to 1). |
r0_custom |
The basic reproduction number (R0) for a custom disease. Required only if 'disease' is "Custom". |
The effective reproduction number (Re).
# For a standard disease calc_re(vc = 0.92, disease = "Measles", VE = 0.97) # For a custom disease like mumps (R0 approx. 10-12) calc_re(vc = 0.88, disease = "Custom", VE = 0.85, r0_custom = 11)# For a standard disease calc_re(vc = 0.92, disease = "Measles", VE = 0.97) # For a custom disease like mumps (R0 approx. 10-12) calc_re(vc = 0.88, disease = "Custom", VE = 0.85, r0_custom = 11)
A dataset containing the percentage of kindergarten students who have completed required immunizations for school entry in Florida counties.
florida_vaccine_coverageflorida_vaccine_coverage
A data frame with 748 rows and 3 variables:
The name of the county in Florida, plus a statewide "Florida" total.
The calendar year of the report, from 2016 to 2024.
The proportion (0 to 1) of kindergarten students with complete immunizations.
Florida Department of Health, Bureau of Immunization.
Plot Historical Vaccination Coverage Rate
plot_coverage_history(county_name, save_data_to = NULL)plot_coverage_history(county_name, save_data_to = NULL)
county_name |
A character vector of county names to plot. |
save_data_to |
Optional file path to save the plot's data. |
A ggplot object.
plot_coverage_history(county_name = c("Florida", "Miami-Dade", "Liberty"))plot_coverage_history(county_name = c("Florida", "Miami-Dade", "Liberty"))
Plot Outbreak Probability vs. Coverage
plot_outbreak_prob( disease = "Measles", VE = NULL, r0_custom = NULL, save_data_to = NULL )plot_outbreak_prob( disease = "Measles", VE = NULL, r0_custom = NULL, save_data_to = NULL )
disease |
The disease to model. Default is "Measles". |
VE |
Vaccine effectiveness. If NULL (the default), a sensible default is used for the chosen disease (e.g., 0.97 for Measles). A user-provided value (0 to 1) will override the default. |
r0_custom |
The basic reproduction number (R0) for a custom disease. Required only if 'disease' is "Custom". |
save_data_to |
Optional file path to save the plot's data. |
A ggplot object.
# Plot with default VE for Pertussis (~0.85) plot_outbreak_prob(disease = "Pertussis") # Override default VE for Pertussis plot_outbreak_prob(disease = "Pertussis", VE = 0.91)# Plot with default VE for Pertussis (~0.85) plot_outbreak_prob(disease = "Pertussis") # Override default VE for Pertussis plot_outbreak_prob(disease = "Pertussis", VE = 0.91)
Plot the Risk Curve of Expected Infections
plot_risk_curve( disease = "Measles", kindergarten_size = 200, VE = NULL, r0_custom = NULL, save_data_to = NULL )plot_risk_curve( disease = "Measles", kindergarten_size = 200, VE = NULL, r0_custom = NULL, save_data_to = NULL )
disease |
The disease to model. Default is "Measles". |
kindergarten_size |
The size of the school cohort. Default is 200. |
VE |
Vaccine effectiveness. If NULL (the default), a sensible default is used for the chosen disease (e.g., 0.97 for Measles). A user-provided value (0 to 1) will override the default. |
r0_custom |
The basic reproduction number (R0) for a custom disease. Required only if 'disease' is "Custom". |
save_data_to |
Optional file path to save the plot's underlying data. |
A ggplot object.
# Plot with default VE for Pertussis (~0.85) plot_risk_curve(disease = "Pertussis") # Plot for a custom disease, requires VE and r0_custom plot_risk_curve(disease = "Custom", VE = 0.85, r0_custom = 12)# Plot with default VE for Pertussis (~0.85) plot_risk_curve(disease = "Pertussis") # Plot for a custom disease, requires VE and r0_custom plot_risk_curve(disease = "Custom", VE = 0.85, r0_custom = 12)
Calculate the probability of a major outbreak
prob_major_outbreak(Re)prob_major_outbreak(Re)
Re |
The effective reproduction number. |
The probability of a major outbreak (1 - 1/Re).
prob_major_outbreak(Re = 2.05)prob_major_outbreak(Re = 2.05)
Calculate the probability of at least one secondary infection
prob_sec_case(Re)prob_sec_case(Re)
Re |
The effective reproduction number. |
The probability of at least one secondary infection.
prob_sec_case(Re = 2.05)prob_sec_case(Re = 2.05)
Retrieves and sorts the vaccination coverage rates for all Florida counties for a specified year.
summary_coverage(yr)summary_coverage(yr)
yr |
The year to summarize (e.g., 2024). |
A tibble with columns 'County' and 'Coverage_Rate' (as a numeric proportion), sorted in descending order of the coverage rate.
# Get a summary of vaccine coverage for 2024 summary_coverage(yr = 2024)# Get a summary of vaccine coverage for 2024 summary_coverage(yr = 2024)
Creates a summary table of outbreak risk for a given year. The analysis includes scenarios for the statewide average coverage rate as well as for counties at the minimum, maximum, and quartile coverage rates. This function can model pre-set diseases or a custom disease with a user-specified R0.
summary_infection_risk( yr, disease = "Measles", kindergarten_size = 200, VE = NULL, r0_custom = NULL )summary_infection_risk( yr, disease = "Measles", kindergarten_size = 200, VE = NULL, r0_custom = NULL )
yr |
The year for the analysis (e.g., 2024). |
disease |
The disease to model. Choose from "Measles", "Pertussis", "Chickenpox", or "Custom". Default is "Measles". |
kindergarten_size |
The size of the school cohort. Default is 200. |
VE |
Vaccine effectiveness. If NULL (the default), a sensible default is used for the chosen disease (e.g., 0.97 for Measles). A user-provided value (0 to 1) will override the default. |
r0_custom |
The basic reproduction number (R0) for a custom disease. This parameter is required and must be a positive number if 'disease' is set to "Custom". |
A data frame containing the formatted risk analysis table.
# Example 1: Standard analysis for Measles in 2024 (uses default VE of 0.97) summary_infection_risk(yr = 2024, disease = "Measles") # Example 2: Analysis for Pertussis, overriding the default VE summary_infection_risk(yr = 2024, disease = "Pertussis", VE = 0.91) # Example 3: Analysis for a custom disease (e.g., Mumps-like) summary_infection_risk(yr = 2024, disease = "Custom", VE = 0.88, r0_custom = 11)# Example 1: Standard analysis for Measles in 2024 (uses default VE of 0.97) summary_infection_risk(yr = 2024, disease = "Measles") # Example 2: Analysis for Pertussis, overriding the default VE summary_infection_risk(yr = 2024, disease = "Pertussis", VE = 0.91) # Example 3: Analysis for a custom disease (e.g., Mumps-like) summary_infection_risk(yr = 2024, disease = "Custom", VE = 0.88, r0_custom = 11)