1 |
x |
|
alpha |
|
nboot |
|
bend |
|
os |
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 | ##---- 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, alpha = 0.05, nboot = 399, bend = 1.28, os = FALSE)
{
os <- as.logical(os)
if (length(x) <= 19)
print("The number of observations is less than 20.")
print("This function might fail due to division by zero,")
print("which in turn causes an error in function hpsi")
print("having to do with a missing value.")
set.seed(1)
print("Taking bootstrap samples. Please wait.")
data <- matrix(sample(x, size = length(x) * nboot, replace = T),
nrow = nboot)
if (!os)
bvec <- apply(data, 1, mest, bend)
if (os)
bvec <- apply(data, 1, onestep, bend)
bvec <- sort(bvec)
low <- round((alpha/2) * nboot)
up <- nboot - low
low <- low + 1
list(ci = c(bvec[low], bvec[up]))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.