1 |
J |
|
K |
|
x |
|
est |
|
JK |
|
grp |
|
dif |
|
alpha |
|
nboot |
|
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 | ##---- 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, est = tmean, JK = J * K, grp = c(1:JK), dif = TRUE,
alpha = 0.05, nboot = NA, pr = TRUE, ...)
{
if (is.matrix(x)) {
y <- list()
for (j in 1:ncol(x)) y[[j]] <- x[, j]
x <- y
}
if (pr)
print("As of Sept. 2005, est defaults to tmean")
JK <- J * K
data <- list()
for (j in 1:length(x)) {
data[[j]] <- x[[grp[j]]]
}
x <- data
jp <- 1 - K
kv <- 0
kv2 <- 0
for (j in 1:J) {
jp <- jp + K
xmat <- matrix(NA, ncol = K, nrow = length(x[[jp]]))
for (k in 1:K) {
kv <- kv + 1
xmat[, k] <- x[[kv]]
}
xmat <- elimna(xmat)
for (k in 1:K) {
kv2 <- kv2 + 1
x[[kv2]] <- xmat[, k]
}
}
xx <- x
set.seed(2)
nvec <- NA
jp <- 1 - K
for (j in 1:J) {
jp <- jp + K
nvec[j] <- length(x[[jp]])
}
x <- matrix(NA, nrow = nvec[1], ncol = K)
for (k in 1:K) x[, k] <- xx[[k]]
kc <- K
for (j in 2:J) {
temp <- matrix(NA, nrow = nvec[j], ncol = K)
for (k in 1:K) {
kc <- kc + 1
temp[, k] <- xx[[kc]]
x <- rbind(x, temp)
}
}
temp <- rmmcppb(x, est = est, nboot = nboot, dif = dif, alpha = alpha,
plotit = FALSE, ...)
list(output = temp$output, con = temp$con, num.sig = temp$num.sig)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.