Nothing

knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.align = "center", fig.width = 7, fig.height = 5 )

library(outbreaks) library(incidence2) library(i2extras)

We provide functions to return the peak of the incidence data (grouped or ungrouped), bootstrap from the incidence data, and estimate confidence intervals around a peak.

`bootstrap()`

dat <- fluH7N9_china_2013 x <- incidence(dat, date_index = date_of_onset, groups = gender) bootstrap(x)

`find_peak()`

dat <- fluH7N9_china_2013 x <- incidence(dat, date_index = date_of_onset, groups = gender) # peaks across each group find_peak(x) # peak without groupings find_peak(regroup(x))

`estimate_peak()`

Note that the bootstrapping approach used for estimating the peak time makes the following assumptions:

- the total number of event is known (no uncertainty on total incidence);
- dates with no events (zero incidence) will never be in bootstrapped datasets; and
- the reporting is assumed to be constant over time, i.e. every case is equally likely to be reported.

dat <- fluH7N9_china_2013 x <- incidence(dat, date_index = date_of_onset, groups = province) # regrouping for overall peak (we suspend progress bar for markdown) estimate_peak(regroup(x), progress = FALSE) # across provinces estimate_peak(x, progress = FALSE)

**Any scripts or data that you put into this service are public.**

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.