1 | sisplit(J, K, x)
|
J |
|
K |
|
x |
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 | ##---- 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 (J, K, x)
{
p <- J * K
connum <- (J^2 - J) * (K^2 - K)/4
if (is.matrix(x))
x <- listm(x)
if (!is.list(x))
stop("Data must be stored in a matrix or in list mode")
imap <- matrix(c(1:p), J, K, byrow = T)
outm <- matrix(NA, ncol = 8, nrow = connum)
dimnames(outm) <- list(NULL, c("Fac.A", "Fac.A", "Fac.B",
"Fac.B", "p1", "p2", "ci.low", "ci.up"))
ic <- 0
if (connum <= 28)
qval <- smmcrit(999, connum)
if (connum > 28)
qval <- 2.383904 * connum^0.1 - 0.202
aval <- 4 * (1 - pnorm(qval))
if (J == 2 && K == 2)
aval <- 0.05
if (J == 5 && K == 2)
aval <- 2 * (1 - pnorm(qval))
if (J == 3 && K == 2)
aval <- 3 * (1 - pnorm(qval))
if (J == 4 && K == 2)
aval <- 3 * (1 - pnorm(qval))
if (J == 2 && K == 3)
aval <- 3 * (1 - pnorm(qval))
for (j in 1:J) {
for (jj in 1:J) {
if (j < jj) {
for (k in 1:K) {
for (kk in 1:K) {
if (k < kk) {
dif <- x[[imap[j, k]]] - x[[imap[j, kk]]]
dif <- dif[dif != 0]
dif1 <- (dif < 0)
dif <- (x[[imap[jj, k]]] - x[[imap[jj,
kk]]])
dif <- dif[dif != 0]
dif2 <- (dif < 0)
ic <- ic + 1
outm[ic, 1] <- j
outm[ic, 2] <- jj
outm[ic, 3] <- k
outm[ic, 4] <- kk
temp <- twobici(x = dif1, y = dif2, alpha = aval)
outm[ic, 5] <- temp$p1
outm[ic, 6] <- temp$p2
outm[ic, 7] <- temp$ci[1]
outm[ic, 8] <- temp$ci[2]
}
}
}
}
}
}
outm
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.