1  | 
x | 
|
est | 
|
nboot | 
|
SEED | 
|
... | 
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  | ##---- 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 (x, est = hd, nboot = 599, SEED = TRUE, ...) 
{
    if (is.matrix(x)) 
        x <- listm(x)
    if (!is.list(x)) 
        stop("Data must be stored in list mode or a matrix.")
    J <- length(x)
    nval <- vector("numeric", length(x))
    gest <- vector("numeric", length(x))
    if (SEED) 
        set.seed(2)
    bvec <- matrix(0, J, nboot)
    print("Taking bootstrap samples. Please wait.")
    for (j in 1:J) {
        print(paste("Working on group ", j))
        nval[j] <- length(x[[j]])
        gest[j] <- est(x[[j]])
        xcen <- x[[j]] - est(x[[j]], ...)
        data <- matrix(sample(xcen, size = length(x[[j]]) * nboot, 
            replace = TRUE), nrow = nboot)
        bvec[j, ] <- apply(data, 1, est, ...)
    }
    teststat <- wsumsq(gest, nval)
    testb <- apply(bvec, 2, wsumsq, nval)
    p.value <- 1 - sum(teststat >= testb)/nboot
    teststat <- wsumsq(gest, nval)
    list(teststat = teststat, p.value = p.value)
  }
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.