1 |
x |
|
est |
|
nboot |
|
MC |
|
SEED |
|
MM |
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 35 36 37 38 39 40 41 42 43 44 45 | ##---- 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, est = median, nboot = 500, MC = FALSE, SEED = TRUE,
MM = FALSE)
{
if (SEED)
set.seed(2)
if (MC)
library(parallel)
if (is.data.frame(x))
x = as.matrix(x)
if (is.matrix(x))
x = listm(x)
chk = tlist(x)
if (chk != 0) {
if (identical(est, median))
print("Warning: tied values detected. Suggest using est=cidmulv2")
}
J = length(x)
L = (J^2 - J)/2
ic = 0
pvec = NA
boot = list()
MAT = matrix(NA, nrow = nboot, ncol = L)
for (i in 1:nboot) {
for (j in 1:J) {
boot[[j]] = sample(x[[j]], size = length(x[[j]]),
replace = TRUE)
}
MAT[i, ] = wmwloc2(boot)
}
zero = rep(0, L)
bconB = rbind(MAT, zero)
if (MC)
dv = pdisMC(bconB, MM = MM)
if (!MC)
dv = pdis(bconB, MM = MM)
bplus <- nboot + 1
p.value <- 1 - sum(dv[bplus] > dv[1:nboot])/nboot - 0.5 *
sum(dv[bplus] == dv[1:nboot])/nboot
p.value
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.