1 | wmw(x, y)
|
x |
|
y |
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)
{
x = elimna(x)
y = elimna(y)
m <- length(x)
n <- length(y)
com <- rank(c(x, y))
xp1 <- length(x) + 1
x <- com[1:length(x)]
y <- com[xp1:length(com)]
u <- sum(y) - n * (n + 1)/2
sigsq <- m * n * (n + m + 1)/12
yv <- (u + 0.5 - m * n/2)/sqrt(sigsq)
kv <- 20 * m * n * (m + n + 1)/(m^2 + n^2 + n * m + m + n)
S <- yv^2
T1 <- S - 3
T2 <- (155 * S^2 - 416 * S - 195)/42
cv <- 1 + T1/kv + T2/kv^2
sighrw <- 2 * (1 - pnorm(abs(cv * yv)))
z <- (u - (0.5 * m * n))/sqrt(sigsq)
sig <- 2 * (1 - pnorm(abs(z)))
list(p.value = sig, adj.p.value = sighrw, p.hat = u/(n *
m))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.