jackknife {arkhe}R Documentation

Jackknife Estimation

Description

Jackknife Estimation

Usage

jackknife(object, ...)

## S4 method for signature 'numeric'
jackknife(object, do, ..., f = NULL)

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.

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.

Author(s)

N. Frerebeau

See Also

Other resampling methods: bootstrap()

Examples

x <- rnorm(20)

## Bootstrap
bootstrap(x, do = mean, n = 100)

## 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)

## Get the n bootstrap values
bootstrap(x, n = 100, do = mean, f = function(x) { x })

## Jackknife
jackknife(x, do = mean) # Sample mean

## Get the leave-one-out values instead of summary
jackknife(x, do = mean, f = function(x) { x })

[Package arkhe version 1.6.0 Index]