Jackknife Estimation

## Usage

# S4 method for DiversityIndex
jackknife(object, f = NULL)

## Arguments

object

An R object (typically a DiversityIndex object).

f

A function that takes a single numeric vector (the leave-one-out values of do) as argument.

## Value

If f is NULL (the default), jackknife() returns a named numeric

vector with the following elements:

original

The observed value of do applied to object.

mean

The jackknife estimate of mean of do.

bias

The jackknife estimate of bias of do.

error

he jackknife estimate of standard error of do.

If f is a function, jackknife() returns the result of f applied to the leave-one-out values of do.

Other resampling methods: bootstrap_diversity, resample()

N. Frerebeau

## Examples

## Data from Conkey 1980, Kintigh 1989
data("cantabria")

## Shannon diversity index
(h <- heterogeneity(cantabria, method = "shannon"))
#> [1] 3.269200 2.955298 2.491683 2.485604 2.329187

## Bootstrap resampling
bootstrap(h, f = NULL)
#>                  original     mean        bias      error
#> Altamira         3.269200 3.279714  0.01051419 0.08185864
#> Cueto de la Mina 2.955298 2.977515  0.02221663 0.14373862
#> El Juyo          2.491683 2.527447  0.03576373 0.19663436
#> El Cierro        2.485604 2.469893 -0.01571057 0.22712988
#> La Paloma        2.329187 2.315450 -0.01373645 0.26656843

bootstrap(h, f = summary)
#>                      Min.  1st Qu.   Median     Mean  3rd Qu.     Max.
#> Altamira         2.992371 3.227988 3.287283 3.282595 3.338554 3.515478
#> Cueto de la Mina 2.385533 2.877492 2.981162 2.971595 3.080032 3.416998
#> El Juyo          1.789465 2.399430 2.535259 2.526290 2.655818 3.156351
#> El Cierro        1.671595 2.347406 2.502669 2.487031 2.641692 3.068166
#> La Paloma        1.153742 2.166085 2.343960 2.319377 2.500138 2.956489

quant <- function(x) quantile(x, probs = c(0.25, 0.50))
bootstrap(h, f = quant)
#>                       25%      50%
#> Altamira         3.231672 3.285306
#> Cueto de la Mina 2.869989 2.972694
#> El Juyo          2.409396 2.545489
#> El Cierro        2.350045 2.497580
#> La Paloma        2.180840 2.350792

## Jackknife resampling
jackknife(h)
#>                  original     mean       bias      error
#> Altamira         3.269200 3.246457 -0.9779158 0.08145529
#> Cueto de la Mina 2.955298 2.932856 -0.9649994 0.15907033
#> El Juyo          2.491683 2.469588 -0.9500688 0.19670002
#> El Cierro        2.485604 2.462723 -0.9838709 0.22195573
#> La Paloma        2.329187 2.305876 -1.0023704 0.25266291

bootstrap(h, f = summary)
#>                       Min.  1st Qu.   Median     Mean  3rd Qu.     Max.
#> Altamira         2.9337641 3.230374 3.282686 3.278260 3.332086 3.509624
#> Cueto de la Mina 2.1808323 2.883026 2.990717 2.977999 3.082980 3.378439
#> El Juyo          1.7527782 2.406264 2.545033 2.529992 2.666218 3.225738
#> El Cierro        1.4708085 2.361778 2.515667 2.490385 2.645913 3.041653
#> La Paloma        0.8675632 2.141157 2.334716 2.301780 2.485160 2.928880