1 | qhatd(x, y, nboot = 50)
|
x |
|
y |
|
nboot |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ##---- 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, nboot = 50)
{
set.seed(2)
print("Taking bootstrap samples. Please wait.")
data <- matrix(sample(length(x), size = length(x) * nboot,
replace = TRUE), nrow = nboot)
bid <- apply(data, 1, idb, length(x))
yhat <- apply(data, 1, qhatds1, x, y)
bi <- apply(bid, 1, sum)
temp <- (bid * yhat)
diff <- apply(temp, 1, sum)
temp <- diff/bi
ep0 <- sum(temp[!is.na(temp)])/length(y)
aperror <- disker(x, y)$phat
regpre <- 0.368 * aperror + 0.632 * ep0
list(app.error = aperror, qhat.632 = regpre)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.