1 |
J |
|
K |
|
L |
|
x |
|
tr |
|
con |
|
alpha |
|
grp |
|
op |
|
pr |
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 | ##---- 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, L, x, tr = 0.2, con = 0, alpha = 0.05, grp = NA,
op = FALSE, pr = TRUE)
{
if (is.data.frame(x))
x = as.matrix(x)
JKL <- J * K * L
if (is.matrix(x))
x <- listm(x)
if (!is.na(grp[1])) {
yy <- x
x <- list()
for (j in 1:length(grp)) x[[j]] <- yy[[grp[j]]]
}
if (!is.list(x))
stop("Data must be stored in list mode or a matrix.")
for (j in 1:JKL) {
xx <- x[[j]]
x[[j]] <- xx[!is.na(xx)]
}
if (JKL != length(x))
warning("The number of groups does not match the number of contrast coefficients.")
for (j in 1:JKL) {
temp <- x[[j]]
temp <- temp[!is.na(temp)]
x[[j]] <- temp
}
temp <- con3way(J, K, L)
conA <- temp$conA
conB <- temp$conB
conC <- temp$conC
conAB <- temp$conAB
conAC <- temp$conAC
conBC <- temp$conBC
conABC <- temp$conABC
if (!op) {
Factor.A <- lincon(x, con = conA, tr = tr, alpha = alpha,
pr = pr)
Factor.B <- lincon(x, con = conB, tr = tr, alpha = alpha,
pr = pr)
Factor.C <- lincon(x, con = conC, tr = tr, alpha = alpha,
pr = pr)
Factor.AB <- lincon(x, con = conAB, tr = tr, alpha = alpha,
pr = pr)
Factor.AC <- lincon(x, con = conAC, tr = tr, alpha = alpha,
pr = pr)
Factor.BC <- lincon(x, con = conBC, tr = tr, alpha = alpha,
pr = pr)
Factor.ABC <- lincon(x, con = conABC, tr = tr, alpha = alpha,
pr = pr)
}
All.Tests <- NA
if (op) {
Factor.A <- NA
Factor.B <- NA
Factor.C <- NA
Factor.AB <- NA
Factor.AC <- NA
Factor.BC <- NA
Factor.ABC <- NA
con <- cbind(conA, conB, conB, conAB, conAC, conBC, conABC)
All.Tests <- lincon(x, con = con, tr = tr, alpha = alpha,
, pr = pr)
}
list(Factor.A = Factor.A, Factor.B = Factor.B, Factor.C = Factor.C,
Factor.AB = Factor.AB, Factor.AC = Factor.AC, Factor.BC = Factor.BC,
Factor.ABC = Factor.ABC, All.Tests = All.Tests, conA = conA,
conB = conB, conC = conC, conAB = conAB, conAC = conAC,
conBC = conBC, conABC = conABC)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.