boot.t.test: Bootstrap t-test

View source: R/boot.t.test.R

boot.t.testR Documentation

Bootstrap t-test

Description

Performs the bootstrap t-test as described in Algorithm 16.2 in Efron and Tibshirani (1993).

Usage

boot.t.test(x, y, reps = 1000, mu = 0, alternative = c("two.sided", "less", "greater"))

Arguments

x

Vector of values from the first group.

y

Vector of values from the second group.

reps

Number of bootstrap replications to use.

mu

Null hypothesised difference between the group means.

alternative

The alternative hypothesis to use (default = "two.sided").

Details

The numerator of the test statistic is calculated as (x - y) - mu.

Value

Returns a list containing the following items:

mu0

The null hypothesised difference.

statistic

The test statistic.

alternative

Alternative hypothesis.

p.value

The p-value for the test.

Author(s)

Theo Pepler

References

Efron, B. and Tibshirani, R. (1993). An Introduction to the Bootstrap. Chapman and Hall/CRC.

Examples

xvec <- rnorm(15)
yvec <- rnorm(15) - 0.7
boot.t.test(x = xvec, y = yvec)
boot.t.test(x = xvec, y = yvec, mu = 0.7)

tpepler/nonpar documentation built on May 13, 2023, 11:23 a.m.