bsqrm:

Usage Arguments Examples

Usage

1
bsqrm(x, y, alpha = 0.05, bend = 1.28)

Arguments

x
y
alpha
bend

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
##---- 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, y, alpha = 0.05, bend = 1.28) 
{
    x <- x[!is.na(x)]
    y <- y[!is.na(y)]
    zc <- qnorm(alpha/2)
    x2 <- (x - median(x))/mad(x)
    y2 <- (y - median(y))/mad(y)
    C <- length(x[abs(x2) > bend])
    D <- length(y[abs(y2) > bend])
    e <- c(C, D)
    alist <- list(x, y)
    f <- (sapply(alist, length)) - e
    s = sapply(alist, mestse)^2
    wden = sum(1/s)
    w = (1/s)/wden
    yplus <- sum(w * (sapply(alist, onestep)))
    tt <- ((sapply(alist, onestep)) - yplus)/sqrt(s)
    v <- (f - 1)
    z <- ((4 * v^2) + (5 * ((2 * (zc^2)) + 3)/24))/((4 * v^2) + 
        v + (((4 * (zc^2)) + 9)/12)) * sqrt(v) * (sqrt(log(1 + 
        (tt^2/v))))
    teststat <- sum(z^2)
    list(teststat = teststat)
  }

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