1 | yhall(x, y, tr = 0.2, alpha = 0.05)
|
x |
|
y |
|
tr |
|
alpha |
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 | ##---- 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, y, tr = 0.2, alpha = 0.05)
{
x <- x[!is.na(x)]
y <- y[!is.na(y)]
winx <- winval(x, tr = tr)
winy <- winval(y, tr = tr)
m3x <- sum((winx - mean(winx))^3)/length(x)
m3y <- sum((winy - mean(winy))^3)/length(y)
h1 <- length(x) - 2 * floor(tr * length(x))
h2 <- length(y) - 2 * floor(tr * length(y))
mwx <- length(x) * m3x/h1
mwy <- length(y) * m3y/h2
q1 <- (length(x) - 1) * winvar(x, tr)/(h1 * (h1 - 1))
q2 <- (length(y) - 1) * winvar(y, tr)/(h2 * (h2 - 1))
sigtil <- q1 + q2
mtil <- (mwx/h1^2) - (mwy/h2^2)
dif <- mean(x, tr) - mean(y, tr)
thall <- dif + mtil/(6 * sigtil) + mtil * dif^2/(3 * sigtil^2) +
mtil^2 * dif^3/(27 * sigtil^4)
thall <- thall/sqrt(sigtil)
nhat <- mtil/sigtil^1.5
list(test.stat = thall, nu.tilda = nhat, sig.tilda = sqrt(sigtil))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.