# For a cohort under 12 years old and born in 2000, return the
# probabilities of primary infection in 2000, 2001, ... 2012:
get_p_infection_year(
birth_year = 2000,
observation_year = 2022,
intensity_df = get_country_intensity_data("Canada", 2022),
max_year = 2022
)
# If the cohort is still under age 12 at the time of observation, return
# a truncated vector of probabilities:
get_p_infection_year(
birth_year = 2020,
observation_year = 2022,
intensity_df = get_country_intensity_data("Mexico", 2022),
max_year = 2022
)
Run the code above in your browser using DataLab