1 |
x |
|
y |
|
xout |
|
outfun |
|
STAND |
|
... |
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 | ##---- 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, xout = FALSE, outfun = outpro, STAND = TRUE,
...)
{
x <- as.matrix(x)
xx <- cbind(x, y)
xx <- elimna(xx)
x <- xx[, 1:ncol(x)]
x <- as.matrix(x)
y <- xx[, ncol(x) + 1]
temp <- NA
x <- as.matrix(x)
if (xout) {
x <- as.matrix(x)
flag <- outfun(x, plotit = plotit, ...)$keep
x <- x[flag, ]
y <- y[flag]
x <- as.matrix(x)
}
library(robustbase)
coef = ltsReg(y ~ x)[8]$coefficients
list(coef = coef)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.