1 |
J |
|
K |
|
x |
|
fr |
|
aval |
|
xlab |
|
ylab |
|
color |
|
BOX |
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 | ##---- 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, fr = 0.8, aval = 0.5, xlab = "X", ylab = "",
color = rep("black", 5), BOX = FALSE)
{
if (K != 2)
stop("Should have only two dependent variables")
if (J > 5)
stop("Can only have five levels for the independent factor")
if (is.matrix(x)) {
y <- list()
for (j in 1:ncol(x)) y[[j]] <- x[, j]
x <- y
}
dif = list()
for (j in 1:5) dif[[j]] = NULL
JK = J * K
m <- matrix(c(1:JK), J, K, byrow = T)
ic <- c(-1, 0)
for (j in 1:J) {
ic <- ic + 2
dif[[j]] = x[[ic[1]]] - x[[ic[2]]]
}
if (!BOX)
g5plot(dif[[1]], dif[[2]], dif[[3]], dif[[4]], dif[[5]],
fr = fr, aval = aval, xlab = xlab, ylab = ylab, color = color)
if (BOX)
boxplot(dif)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.