1 |
x |
|
y |
|
sc |
|
xout |
|
outfun |
|
plotit |
|
... |
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 | ##---- 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, sc = pbvar, xout = FALSE, outfun = out, plotit = FALSE,
...)
{
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]
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)
}
res = snmreg(x, y)$res
chk <- abs(res - median(res))/mad(res)
xx <- x[chk <= 2, ]
yy <- y[chk <= 2]
temp <- tsreg(xx, yy)
list(coef = temp$coef, residuals = temp$res)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.