1 |
x |
|
q |
|
op |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ##---- 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, q = 0.5, op = 3)
{
y <- sort(x)
n <- length(x)
iq <- floor(q * n + 0.5)
qest <- y[iq]
fhat <- NA
if (op == 1)
fhat <- kerden(x, q)
if (op == 2)
fhat <- rdplot(x, pts = qest, pyhat = TRUE, plotit = FALSE)
if (op == 3)
fhat <- akerd(x, pts = qest, pyhat = TRUE, plotit = FALSE)
if (is.na(fhat[1]))
stop("Something wrong, op should be 1 or 2 or 3")
qse <- 1/(2 * sqrt(length(x)) * fhat)
qse
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.