Plots inferred historical attack rates from the MCMC output on infection histories for monthly. The main difference compared to the normal attack rate plot is that pointrange plots don't make as much sense at a very fine time resolution.
plot_attack_rates_monthly( infection_histories, titre_dat, strain_isolation_times, n_alive = NULL, ymax = 1, buckets = 1, pad_chain = TRUE, true_ar = NULL, by_group = FALSE, group_subset = NULL, cumulative = FALSE )
infection_histories | the MCMC chain for infection histories |
---|---|
titre_dat | the data frame of titre data |
strain_isolation_times | vector of the epochs of potential circulation |
n_alive | vector with the number of people alive in each year of circulation. Can be left as NULL, and ages will be used to infer this |
ymax | Numeric. the maximum y value to put on the axis. Default = 1. |
buckets | Integer. How many buckets of time is each year split into? ie. 12 for monthly data, 4 for quarterly etc. Default = 1. |
pad_chain | if TRUE, fills the infection history data table with entries for non-infection events (ie. 0s). Can be switched to FALSE for speed to get a rough idea of what the attack rates look like. |
true_ar | data frame of true attack rates, with first column `year` equal to `strain_isolation_times`, and second column `AR` giving the attack rate. Column names: group, j, AR |
by_group | if TRUE, facets the plot by group ID |
group_subset | if not NULL, plots only this subset of groups eg. 1:5 |
cumulative | if TRUE, plots the cumulative attack rate |
a ggplot2 object with the inferred attack rates for each potential epoch of circulation