bootstrap | R Documentation |
Bootstrap Estimation
## S4 method for signature 'DiversityIndex'
bootstrap(
object,
n = 1000,
f = NULL,
level = 0.95,
interval = c("basic", "normal", "percentiles"),
seed = NULL,
rare = FALSE
)
object |
An R object (typically a DiversityIndex object). |
n |
A non-negative |
f |
A |
level |
A length-one |
interval |
A |
seed |
An object specifying if and how the random number generator
should be initialized (see |
rare |
A |
n
random samples are drawn, each with the same sample size as in the
original sample and with class probabilities proportional to the original
abundances.
Note that the mean of the bootstrapped samples will often be much lower than the observed value. Bootstrapping results must be interpreted with great care.
If f
is NULL
(the default), bootstrap()
returns a numeric
matrix
with the following columns:
original
The observed value.
mean
The bootstrap estimate of mean.
bias
The bootstrap estimate of bias.
error
The bootstrap estimate of standard error.
lower
The lower limit of the bootstrap confidence interval at level
.
upper
The upper limit of the bootstrap confidence interval at level
.
If f
is a function
, bootstrap()
returns the result of f
applied to
the values computed from the n
replications.
N. Frerebeau
Other resampling methods:
jackknife()
## Data from Conkey 1980, Kintigh 1989
data("cantabria")
## Shannon diversity index
(h <- heterogeneity(cantabria, method = "shannon"))
## Bootstrap resampling
bootstrap(h)
bootstrap(h, f = summary)
quant <- function(x) quantile(x, probs = c(0.05, 0.95))
bootstrap(h, f = quant)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.