1 | lplot.pred(x, y, pts = x, xout = FALSE, outfun = outpro, span = 2/3, family = "gaussian", ...)
|
x |
|
y |
|
pts |
|
xout |
|
outfun |
|
span |
|
family |
|
... |
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 | ##---- 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, pts = x, xout = FALSE, outfun = outpro, span = 2/3,
family = "gaussian", ...)
{
x <- as.matrix(x)
d = ncol(x)
dp1 = d + 1
m <- elimna(cbind(x, y))
n.orig = nrow(m)
n.keep = n.orig
if (xout) {
flag <- outfun(x, plotit = FALSE, ...)$keep
m <- m[flag, ]
n.keep = nrow(m)
}
x <- m[, 1:d]
y <- m[, dp1]
fit = loess(y ~ x, span = span, family = family)
pred = predict(fit, pts)
list(n = n.orig, n.keep = n.keep, yhat = pred)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.