1 |
x |
|
con |
|
plotfun |
|
nboot |
|
plotit |
|
pyhat |
|
... |
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 30 31 32 33 34 35 | ##---- 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, con = 0, plotfun = akerd, nboot = 800, plotit = TRUE,
pyhat = FALSE, ...)
{
if (is.matrix(x))
x <- listm(x)
if (!is.list(x))
stop("Data must be stored in list mode or in matrix mode.")
J <- length(x)
tempn <- 0
mvec <- NA
for (j in 1:J) {
temp <- x[[j]]
temp <- temp[!is.na(temp)]
tempn[j] <- length(temp)
x[[j]] <- temp
}
Jm <- J - 1
if (sum(con^2) == 0)
con <- matrix(1, J, 1)
bvec <- matrix(NA, nrow = J, ncol = nboot)
for (j in 1:J) {
data <- matrix(sample(x[[j]], size = nboot, replace = TRUE),
nrow = nboot)
bvec[j, ] <- data
}
bcon <- t(con) %*% bvec
bcon <- as.vector(bcon)
dval <- plotfun(bcon, pyhat = pyhat, ...)
dval
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.