1 |
x |
|
alpha |
|
grp |
|
tr |
|
bhop |
|
J |
|
p |
|
... |
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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | ##---- 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, alpha = 0.05, grp = NA, tr = 0.2, bhop = FALSE,
J = NULL, p = NULL, ...)
{
con <- as.matrix(con)
if (is.matrix(x) || is.data.frame(x)) {
if (is.null(J) && is.null(p))
stop("Specify J or P")
x = MAT2list(x, p = p, J = J)
}
if (!is.list(x))
stop("Data must be stored in list mode.")
if (!is.na(sum(grp))) {
xx <- list()
for (i in 1:length(grp)) xx[[i]] <- x[[grp[i]]]
x <- xx
}
J <- length(x)
nullvec = rep(0, ncol(x[[1]]))
bplus = nboot + 1
tempn <- 0
mvec <- list
for (j in 1:J) {
x[[j]] <- elimna(x[[j]])
}
Jm <- J - 1
ncon <- (J^2 - J)/2
if (!bhop) {
if (alpha == 0.05) {
dvec <- c(0.05, 0.025, 0.0169, 0.0127, 0.0102, 0.00851,
0.0073, 0.00639, 0.00568, 0.00511)
if (ncon > 10) {
avec <- 0.05/c(11:ncon)
dvec <- c(dvec, avec)
}
}
if (alpha == 0.01) {
dvec <- c(0.01, 0.005, 0.00334, 0.00251, 0.00201,
0.00167, 0.00143, 0.00126, 0.00112, 0.00101)
if (ncon > 10) {
avec <- 0.01/c(11:ncon)
dvec <- c(dvec, avec)
}
}
if (alpha != 0.05 && alpha != 0.01) {
dvec <- alpha/c(1:ncon)
}
}
if (bhop)
dvec <- (ncon - c(1:ncon) + 1) * alpha/ncon
output <- matrix(0, ncon, 4)
dimnames(output) <- list(NULL, c("Group", "Group", "p.value",
"p.crit"))
ic = 0
for (j in 1:Jm) {
jp <- j + 1
for (k in jp:J) {
ic = ic + 1
output[ic, 1] = j
output[ic, 2] = k
output[ic, 3] <- YYmanova(x[[j]], x[[k]], tr = tr)$p.value
}
}
test = output[, 3]
temp2 <- order(0 - test)
zvec <- dvec[1:ncon]
sigvec <- (test[temp2] >= zvec)
output[temp2, 4] <- zvec
num.sig <- sum(output[, 3] <= output[, 4])
list(output = output, num.sig = num.sig)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.