Skip to contents

Jackknife Estimation

Usage

jackknife(object, ...)

# S4 method for numeric
jackknife(object, do, ...)

Arguments

object

A numeric vector.

...

Extra arguments to be passed to do.

do

A function that takes object as an argument and returns a single numeric value.

Value

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.

See also

Other resampling methods: bootstrap()

Author

N. Frerebeau

Examples

x <- rnorm(20)

## Bootstrap
bootstrap(x, do = mean, n = 100)
#>    original        mean        bias       error 
#> -0.31855823 -0.30325519  0.01530304  0.27985046 

## Estimate the 25th and 95th percentiles
quant <- function(x) { quantile(x, probs = c(0.25, 0.75)) }
bootstrap(x, n = 100, do = mean, f = quant)
#>        25%        75% 
#> -0.4891911 -0.1542189 

## Jackknife
jackknife(x, do = mean) # Sample mean
#>   original       mean       bias      error 
#> -0.3185582 -0.3185582  0.0000000  0.2915797