boot.ttest2: Bootstrap t-test for 2 independent samples

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/ttest_related_functions.R

Description

Bootstrap t-test for 2 independent samples.

Usage

1
boot.ttest2(x, y, B = 999)

Arguments

x

A numerical vector with the data.

y

A numerical vector with the data.

B

The number of bootstrap samples to use.

Details

Instead of sampling B times from each sample, we sample √{B} from each of them and then take all pairs. Each bootstrap sample is independent of each other, hence there is no violation of the theory.

Value

A vector with the test statistic and the bootstrap p-value.

Author(s)

Michail Tsagris and Christina Chatzipantsiou

R implementation and documentation: Michail Tsagris <mtsagris@uoc.gr> and Christina Chatzipantsiou <chatzipantsiou@gmail.com>.

References

B.L. Welch (1951). On the comparison of several mean values: an alternative approach. Biometrika, 38(3/4), 330-336.

Efron Bradley and Robert J. Tibshirani (1993). An introduction to the bootstrap. New York: Chapman \& Hall/CRC.

Chatzipantsiou C., Dimitriadis M., Papadakis M. and Tsagris M. (2019). Extremely efficient permutation and bootstrap hypothesis tests using R. To appear in the Journal of Modern Applied Statistical Methods.

https://arxiv.org/ftp/arxiv/papers/1806/1806.10947.pdf

See Also

ttest2, exact.ttest2, ftest

Examples

1
2
3
4
5
tic <- proc.time()
x <- rexp(40, 4)
y <- rbeta(50, 2.5, 7.5)
system.time( a <- boot.ttest2(x, y, 9999) )
a

Example output

Loading required package: Rcpp
Loading required package: RcppZiggurat
   user  system elapsed 
  0.000   0.003   0.005 
             stat bootstrap p-value 
       0.04347153        0.96210379 

Rfast documentation built on May 18, 2021, 1:07 a.m.