1 |
x |
|
y |
|
q |
|
xlab |
|
ylab |
|
pc |
|
xout |
|
outfun |
|
nboot |
|
fr |
|
... |
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 | ##---- 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, q = 0.5, xlab = "X", ylab = "Y", pc = ".", xout = FALSE,
outfun = out, nboot = 40, fr = 1, ...)
{
xy = elimna(cbind(x, y))
x = as.matrix(x)
if (ncol(x) != 1)
stop("Only one predictor is allowed")
x = xy[, 1]
y = xy[, 2]
if (xout) {
flag <- outfun(x, ...)$keep
x <- x[flag]
y <- y[flag]
}
plot(x, y, xlab = xlab, ylab = ylab, pch = pc)
xord = order(x)
for (j in 1:length(q)) {
yhat = rplotsm(x, y, fr = fr, pyhat = TRUE, est = hd,
q = q[j], plotit = FALSE, nboot = nboot)$yhat
lines(x[xord], yhat[xord])
}
print("Done")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.