bootstrap_incidence | R Documentation |
This function can be used to bootstrap incidence2 objects. Bootstrapping is done by sampling with replacement the original input dates.
bootstrap_incidence(x, randomise_groups = FALSE)
x |
An incidence2 object. |
randomise_groups |
Should groups be randomised as well in the resampling procedure; respective group sizes will be preserved, but this can be used to remove any group-specific temporal dynamics. If |
As original data are not stored in incidence2 objects, the bootstrapping is achieved by multinomial sampling of date bins weighted by their relative incidence.
An incidence2 object.
Thibaut Jombart, Tim Taylor
if (requireNamespace("outbreaks", quietly = TRUE)) {
data(fluH7N9_china_2013, package = "outbreaks")
i <- incidence(
fluH7N9_china_2013,
date_index = "date_of_onset",
groups = "gender"
)
bootstrap_incidence(i)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.