1 |
x |
|
y |
|
pval |
|
regfun |
|
fr |
|
est |
|
op |
|
xlab |
|
ylab |
|
xout |
|
outfun |
|
... |
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 30 31 32 33 | ##---- 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, pval = ncol(x), regfun = tsreg, fr = 0.8, est = onestep,
op = 1, xlab = "X", ylab = "Residuals", xout = FALSE, outfun = out,
...)
{
x = as.matrix(x)
p = ncol(x)
p1 = p + 1
temp = elimna(cbind(x, y))
x = temp[, 1:p]
y = temp[, p1]
if (xout) {
flag <- outfun(x, ...)$keep
x <- as.matrix(x)
x <- x[flag, ]
y <- y[flag]
x <- as.matrix(x)
}
if (!is.matrix(x))
stop("Should have two or more variables stored in a matrix")
flag <- rep(T, ncol(x))
flag[pval] <- F
temp <- regfun(x[, flag], y)$residual
if (op != 1)
rungen(x[, !flag], temp, est = est, fr = fr, xlab = xlab,
ylab = ylab, ...)
if (op == 1)
lplot(x[, !flag], temp, xlab = xlab, ylab = ylab)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.