t1waybtsqrk:

Usage Arguments Examples

Usage

1
t1waybtsqrk(x, alpha = 0.05, nboot = 599, B = nboot, tr = 0.2)

Arguments

x
alpha
nboot
B
tr

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (x, alpha = 0.05, nboot = 599, B = nboot, tr = 0.2) 
{
    if (is.matrix(x)) 
        x = listm(x)
    x = lapply(x, elimna)
    T <- btsqrk(x, alpha = alpha, tr = tr)$teststat
    means <- c()
    ylist <- list(0)
    TT <- c()
    b <- floor((1 - alpha) * B)
    means <- sapply(x, mean, tr)
    k <- length(x)
    for (i in 1:B) {
        for (j in 1:k) {
            ylist[[j]] <- (sample(x[[j]], length(x[[j]]), replace = T) - 
                means[j])
        }
        TT <- c(TT, btsqrk(ylist, alpha, tr)$teststat)
    }
    TT = sort(TT)
    pval <- mean(T <= TT, na.rm = TRUE)
    list(test.stat = T, crit.value = TT[b], p.value = pval)
  }

musto101/wilcox_R documentation built on May 23, 2019, 10:52 a.m.