1 |
x |
|
delta |
|
ci |
|
nboot |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ##---- 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, delta = 0, ci = FALSE, nboot = 800)
{
temp1 <- powest(x, rep(0, 5), delta, se = trimse(x))
if (ci) {
set.seed(2)
pboot <- NA
datay <- rep(0, 5)
print("Taking bootstrap samples. Please wait.")
datax <- matrix(sample(x, size = length(x) * nboot, replace = TRUE),
nrow = nboot)
for (i in 1:nboot) {
se <- trimse(datax[i, ])
pboot[i] <- powest(x, rep(0, 5), delta, se)
}
temp <- sort(pboot)
}
ll <- floor(0.05 * nboot + 0.5)
list(est.power = temp1, ci = temp[ll])
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.