1 |
x |
|
tr |
|
alpha |
|
null.value |
|
pr |
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 | ##---- 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, tr = 0.2, alpha = 0.05, null.value = 0, pr = TRUE)
{
library(MASS)
x <- elimna(x)
se <- sqrt(winvar(x, tr))/((1 - 2 * tr) * sqrt(length(x)))
trimci <- vector(mode = "numeric", length = 2)
df <- length(x) - 2 * floor(tr * length(x)) - 1
trimci[1] <- mean(x, tr) - qt(1 - alpha/2, df) * se
trimci[2] <- mean(x, tr) + qt(1 - alpha/2, df) * se
test <- (mean(x, tr) - null.value)/se
sig <- 2 * (1 - pt(abs(test), df))
if (tr == 0)
term = 1
if (tr > 0)
term = sqrt(area(dnormvar, qnorm(tr), qnorm(1 - tr)) +
2 * (qnorm(tr)^2) * tr)
epow = (mean(x, tr) - null.value) * term/sqrt(winvar(x, tr = tr,
na.rm = TRUE))
list(ci = trimci, estimate = mean(x, tr), test.stat = test,
se = se, p.value = sig, n = length(x), Effect.Size = epow)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.