spear:

Usage Arguments Examples

Usage

1
spear(x, y = NULL)

Arguments

x
y

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
##---- 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 = NULL) 
{
    if (!is.null(y[1])) {
        m = elimna(cbind(x, y))
        x = m[, 1]
        y = m[, 2]
        corv <- cor(rank(x), rank(y))
    }
    if (is.null(y[1])) {
        x = elimna(x)
        m <- apply(x, 2, rank)
        corv <- cor(m)
    }
    test <- corv * sqrt((length(x) - 2)/(1 - corv^2))
    sig <- 2 * (1 - pt(abs(test), length(x) - 2))
    if (is.null(y[1])) 
        sig <- matrix(sig, ncol = sqrt(length(sig)))
    list(cor = corv, p.value = sig)
  }

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