Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bootstrap

Bootstrap incidence time series


Description

This function can be used to bootstrap incidence objects. Bootstrapping is done by sampling with replacement the original input dates. See details for more information on how this is implemented.

Usage

bootstrap(x, randomise_groups = FALSE)

Arguments

x

An incidence object.

randomise_groups

A logical indicating whether groups should 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 FALSE (default), data are resampled within groups.

Details

As original data are not stored in incidence objects, the bootstrapping is achieved by multinomial sampling of date bins weighted by their relative incidence.

Value

An incidence object.

Author(s)

Thibaut Jombart thibautjombart@gmail.com

See Also

find_peak to use estimate peak date using bootstrap

Examples

if (require(outbreaks) && require(ggplot2)) { withAutoprint({
  i <- incidence(fluH7N9_china_2013$date_of_onset)
  i
  plot(i)

  ## one simple bootstrap
  x <- bootstrap(i)
  x
  plot(x)

})}

incidence

Compute, Handle, Plot and Model Incidence of Dated Events

v1.7.3
MIT + file LICENSE
Authors
Thibaut Jombart [aut], Zhian N. Kamvar [aut] (<https://orcid.org/0000-0003-1458-7108>), Rich FitzJohn [aut], Tim Taylor [cre] (<https://orcid.org/0000-0002-8587-7113>), Jun Cai [ctb] (<https://orcid.org/0000-0001-9495-1226>), Sangeeta Bhatia [ctb], Jakob Schumacher [ctb], Juliet R.C. Pulliam [ctb] (<https://orcid.org/0000-0003-3314-8223>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.