1 |
J |
|
K |
|
x |
|
alpha |
|
p |
|
grp |
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 | ##---- 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, alpha = 0.05, p = J * K, grp = c(1:p))
{
if (is.matrix(x))
x <- listm(x)
if (!is.list(x))
stop("Data must be stored in a matrix or in list mode.")
CCJ <- (J^2 - J)/2
CCK <- (K^2 - K)/2
CC <- CCJ * CCK
test <- matrix(NA, CC, 7)
test.p <- matrix(NA, CC, 7)
for (j in 1:J) {
xx <- !is.na(x[[j]])
val <- x[[j]]
x[[j]] <- val[xx]
}
mat <- matrix(grp, ncol = K, byrow = T)
dimnames(test) <- list(NULL, c("Factor A", "Factor A", "Factor B",
"Factor B", "delta", "ci.lower", "ci.upper"))
jcom <- 0
crit <- smmcrit(200, CC)
if (alpha != 0.05)
crit <- smmcrit01(200, CC)
alpha <- 1 - pnorm(crit)
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) {
jcom <- jcom + 1
test[jcom, 1] <- j
test[jcom, 2] <- jj
test[jcom, 3] <- k
test[jcom, 4] <- kk
temp1 <- cid(x[[mat[j, k]]], x[[mat[j,
kk]]])
temp2 <- cid(x[[mat[jj, k]]], x[[mat[jj,
kk]]])
delta <- temp2$d - temp1$d
sqse <- temp1$sqse.d + temp2$sqse.d
test[jcom, 5] <- delta/2
test[jcom, 6] <- delta/2 - crit * sqrt(sqse/4)
test[jcom, 7] <- delta/2 + crit * sqrt(sqse/4)
}
}
}
}
}
}
list(test = test)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.