1 |
alist |
|
alpha |
|
tr |
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 | ##---- 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 (alist, alpha = 0.05, tr = 0.2)
{
k <- length(alist)
for (i in 1:k) {
alist[[i]] <- alist[[i]][!is.na(alist[[i]])]
}
zc <- qnorm(alpha/2)
e = trunc(tr * sapply(alist, length))
f <- (sapply(alist, length)) - (2 * e)
s = sapply(alist, trimse, tr = tr)^2
wden = sum(1/s)
w = (1/s)/wden
yplus <- sum(w * (sapply(alist, mean, trim = tr)))
tt <- ((sapply(alist, mean, trim = tr)) - yplus)/sqrt(s)
v <- (f - 1)
z <- ((4 * v^2) + (5 * ((2 * (zc^2)) + 3)/24))/((4 * v^2) +
v + (((4 * (zc^2)) + 9)/12)) * sqrt(v) * (sqrt(log(1 +
(tt^2/v))))
teststat <- sum(z^2)
crit <- qchisq(1 - alpha, k - 1)
bt2pvalue <- 1 - (pchisq(teststat, k - 1))
list(p.value = bt2pvalue, teststat = teststat, crit = crit,
e = e, f = f, s = s, w = w, tt = tt)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.