Given a vector of possible infection times, simulates attack rates from a log-normal distribution with specified mean and log-scale standard deviation.

simulate_attack_rates(
  infection_years,
  mean_par = 0.15,
  sd_par = 0.5,
  large_first_year = FALSE,
  big_year_mean = 0.5,
  n_groups = 1
)

Arguments

infection_years

vector of possible infection times

mean_par

target mean attack rate, either one value or one value per population group

sd_par

standard deviation on the log scale, either one value or one value per population group

large_first_year

logical value indicating whether to simulate an extra-large attack rate in the first time period

big_year_mean

target mean for the first time period when `large_first_year = TRUE`

n_groups

number of population groups to simulate

Value

A long-format data frame with `population_group`, `time`, and `prob_infection` columns.

See also

Other simulation_functions: simulate_data(), simulate_infection_histories()