ts2str:

Usage Arguments Examples

Usage

1
ts2str(xx, y, iv = c(1, 2), nboot = 400, SEED = TRUE)

Arguments

xx
y
iv
nboot
SEED

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
29
30
31
32
33
34
##---- 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 (xx, y, iv = c(1, 2), nboot = 400, SEED = TRUE) 
{
    if (!is.matrix(xx)) 
        stop("x should be a matrix with 2 or more columns")
    if (ncol(xx) < 2) 
        stop("x should be a matrix with 2 or more columns")
    val1 = NA
    val2 = NA
    if (SEED) 
        set.seed(2)
    x = xx[, iv]
    xy = elimna(cbind(x, y))
    x = xy[, 1:2]
    y = xy[, 3]
    data1 <- matrix(sample(length(y), size = length(y) * nboot, 
        replace = TRUE), nrow = nboot)
    data2 <- matrix(sample(length(y), size = length(y) * nboot, 
        replace = TRUE), nrow = nboot)
    bvec1 <- apply(data1, 1, ts2str.sub, x[, 1], y)
    bvec2 <- apply(data2, 1, ts2str.sub, x[, 2], y)
    bvec = bvec1 - bvec2
    pv = akerdcdf(bvec, pts = 0)
    temp = corb(x[, 1], x[, 2], corfun = tau, SEED = FALSE)
    padj = 0.05
    if (temp$p.value <= 0.05) 
        padj = 0.352 * abs(temp$cor.est) + 0.049
    pv = 2 * min(c(pv, 1 - pv))
    list(p.value = pv, p.crit = padj)
  }

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