The boot package
The boot
package is one of the core R packages, and it is optimized for the implementation of bootstrap methods. In the previous examples, we mostly used loops for carrying out the resampling technique. Here, we will look at how to use the boot
R package.
The main structure of the boot function is as follows:
boot(data, statistic, R, sim = "ordinary", stype = c("i", "f", "w"), strata = rep(1,n), L = NULL, m = 0, weights = NULL, ran.gen = function(d, p) d, mle = NULL, simple = FALSE, ..., parallel = c("no", "multicore", "snow"), ncpus = getOption("boot.ncpus", 1L), cl = NULL)
The central arguments of the function are data
, statistic
, R
, and stype
. The data
argument is the standard one, as with most R functions. The statistic
is the most important argument for the implementation of the boot
function and it is this function that will be applied on the bootstrap samples obtained...