1 |
x |
|
q |
|
grp |
|
bop |
|
SEED |
|
mop |
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 | ##---- 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, q = 0.5, grp = NA, bop = FALSE, SEED = TRUE, mop = FALSE)
{
if (is.data.frame(x))
x = as.matrix(x)
if (SEED)
set.seed(2)
if (is.matrix(x))
x <- listm(x)
K <- length(x)
p <- K
if (is.na(grp[1]))
grp <- c(1:p)
x <- x[grp]
if (!is.list(x))
stop("Data are not stored in list mode or a matrix")
tmeans <- 0
n <- length(x[[1]])
v <- matrix(0, p, p)
if (!mop) {
for (i in 1:p) tmeans[i] <- qest(x[[i]], q = q)
if (!bop)
v <- covmmed(x, q = q)
if (bop)
v <- bootcov(x, pr = FALSE, est = qest, q = q)
}
if (mop) {
tmeans[i] <- median(x[[i]])
v <- bootcov(x, pr = FALSE)
}
km1 <- K - 1
ck <- diag(1, km1, K)
for (i in 1:km1) ck[i, i + 1] <- 0 - 1
Qb <- johansp(ck, tmeans, v, n, 1, K)
p.value <- Qb$p.value
if (n >= 20)
p.value <- 1 - pf(Qb$teststat, K - 1, 999)
list(test.stat = Qb$teststat, p.value = p.value)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.