1 | akp.effect(x, y, EQVAR = TRUE, tr = 0.2)
|
x |
|
y |
|
EQVAR |
|
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 (x, y, EQVAR = TRUE, tr = 0.2)
{
library(MASS)
x <- elimna(x)
y <- elimna(y)
n1 <- length(x)
n2 <- length(y)
s1sq = winvar(x, tr = tr)
s2sq = winvar(y, tr = tr)
spsq <- (n1 - 1) * s1sq + (n2 - 1) * s2sq
sp <- sqrt(spsq/(n1 + n2 - 2))
cterm = 1
if (tr > 0)
cterm = area(dnormvar, qnorm(tr), qnorm(1 - tr)) + 2 *
(qnorm(tr)^2) * tr
cterm = sqrt(cterm)
if (EQVAR)
dval <- cterm * (tmean(x, tr) - tmean(y, tr))/sp
if (!EQVAR) {
dval <- cterm * (tmean(x, tr) - tmean(y, tr))/sqrt(s1sq)
dval[2] = cterm * (tmean(x, tr) - tmean(y, tr))/sqrt(s2sq)
}
dval
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.