1 |
x |
|
y |
|
smfun |
|
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 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, smfun = lplot, xout = FALSE, outfun = outpro,
STAND = TRUE, ...)
{
x <- as.matrix(x)
d <- ncol(x)
p1 <- d + 1
temp <- elimna(cbind(x, y))
x <- temp[, 1:d]
y <- temp[, p1]
x <- as.matrix(x)
if (xout) {
m <- cbind(x, y)
flag <- outfun(x, plotit = FALSE, ...)$keep
m <- m[flag, ]
x <- m[, 1:d]
y <- m[, p1]
}
x <- as.matrix(x)
model <- modgen(d)
mout <- matrix(NA, length(model), 2, dimnames = list(NULL,
c("Model", "Explanatory power")))
for (imod in 1:length(model)) {
mout[imod, 1] <- imod
mout[imod, 2] <- smfun(x[, model[[imod]]], y, plotit = FALSE,
...)$Explanatory.power
}
list(models = model, Explanatory.power = mout)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.