resample (version 0.4)

jackknife: One sample jackknife

Description

Basic resampling. Supply the data and statistic to resample.

Usage

jackknife(data, statistic, args.stat = NULL,
          label = NULL, statisticNames = NULL, trace = FALSE)

Arguments

data

vector, matrix, or data frame.

statistic

a function, or expression (e.g. mean(myData, trim = .2).

args.stat

a list of additional arguments to pass to statistic, if it is a function.

label

used for labeling plots (in a future version).

statisticNames

a character vector the same length as the vector returned by statistic.

trace

logical, if TRUE an indication of progress is printed.

Value

a list with class "jackknife" that inherits from "resample", with components:

observed

the value of the statistic for the original data.

replicates

a matrix with R rows and p columns.

n

number of observations in the original data, or vector of length 2 in two-sample problems.

p

length(observed).

R

number of replications.

seed

the value of the seed at the start of sampling.

call

the matched call.

statistics

a data frame with p rows, with columns "observed", "mean" (the mean of the replicates), and other columns appropriate to resampling; e.g. the bootstrap objects have columns "SE" and "Bias", while the permutation test objects have "Alternative" and "PValue".

There are functions for printing and plotting these objects, in particular print, plot, hist, qqnorm, quantile.

See Also

resample-package.

Examples

Run this code
# NOT RUN {
# See full set of examples in resample-package
data(Verizon)
CLEC <- with(Verizon, Time[Group == "CLEC"])
jackknife(CLEC, mean)
# }

Run the code above in your browser using DataCamp Workspace