Skip to contents

Reproduces simpleboot::two.boot: bootstraps the difference FUN(sample1) - FUN(sample2) by stratified resampling of the pooled data (one stratum per sample), matching boot's RNG.

Usage

morie_two_boot(x, y, statistic = mean, R = 1000L, ...)

Arguments

x, y

Numeric vectors.

statistic

A scalar summary applied to each sample (default mean).

R

Number of replicates (default 1000).

...

Passed on to statistic.

Value

A morie_boot object for the difference statistic.

See also

Examples

set.seed(1)
b <- morie_two_boot(rnorm(25), rnorm(25, 0.5), statistic = mean, R = 100L)
str(b, max.level = 1)
#> List of 7
#>  $ t0       : num -0.364
#>  $ t        : num [1:100, 1] -0.197 -0.634 -0.266 -0.703 -0.229 ...
#>  $ R        : int 100
#>  $ data     : num [1:50] -0.626 0.184 -0.836 1.595 0.33 ...
#>  $ statistic:function (d, idx)  
#>  $ strata   : int [1:50] 1 1 1 1 1 1 1 1 1 1 ...
#>  $ index    : int [1:100, 1:50] 12 16 1 13 21 6 17 9 7 23 ...
#>  - attr(*, "class")= chr "morie_boot"