Learn R Programming

popKorn (version 0.3-0)

bootstrapIntervals: Compute Bootstrap Intervals

Description

This function will apply the Bonferroni correction to bootstrap intervals of the mean of the selected populations.

Usage

bootstrapIntervals(X, alpha = 0.05, k = 2, R = 10, return.obj = "intervals", type = "basic", ...)

Arguments

X
is a matrix or data frame that contains the responses. Each column represents a different population.
alpha
denotes the significance level of the intervals to be formed.
k
corresponds to the number of populations to be selected.
R
denotes the number of bootstrap replicate samples to produce.
return.obj
is a character vector of length 1, indicating if this function should return the output of the boot() function, or proceed to compute the bootstrap confidence intervals and return those.
type
is a character vector of length one. It should be one of the following: "norm","basic", "stud", "perc" or "bca".
...
denotes further arguments that will be passed to the boot function.

Value

If return.obj is set to be "boot", then the function returns an object of class "boot". Otherwise, if return.obj is set to be "intervals", then this function returns a matrix with k rows and 3 columns. This is similar to the output of the predict.lm function of R.

Details

The bootstrap that is carried out is the stratified bootstrap, since there are p population in consideration. Within each population, sampling with replacement is carried out, and the largest k sample means are returned.

The user can use any of the 5 confidence interval methods that are present in the boot.ci function. However, a Bonferroni correction will be carried out in order to ensure that the intervals hold simultaneously.

See Also

bonferroniIntervals, asymmetricIntervals

Examples

Run this code
set.seed(18)
p <- 10; n <- 10
Xmat <- matrix(rnorm(p*n), nrow=n, ncol=p)
colnames(Xmat) <- paste("p.", 1:p, sep="")
bootstrapIntervals(Xmat, alpha=0.1, k=4)

Run the code above in your browser using DataLab