1 |
x |
|
y |
|
fr |
|
xout |
|
eout |
|
xlab |
|
ylab |
|
pyhat |
|
plotit |
|
nboot |
|
RNA |
|
SEED |
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 | ##---- 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, fr = 0.6, xout = TRUE, eout = FALSE, xlab = "X",
ylab = "VAR(Y|X)", pyhat = FALSE, plotit = TRUE, nboot = 40,
RNA = FALSE, SEED = TRUE)
{
temp <- cbind(x, y)
temp <- elimna(temp)
x <- temp[, 1]
y <- temp[, 2]
yhat <- lplot(x, y, pyhat = TRUE, plotit = FALSE)$yhat.values
yvar <- (y - yhat)^2
estvar <- runmbo(x, y, est = var, pyhat = TRUE, fr = fr,
plotit = FALSE, RNA = RNA, nboot = nboot)
if (plotit) {
plot(c(x, x), c(yvar, estvar), type = "n", xlab = xlab,
ylab = ylab)
points(x, yvar)
sx <- sort(x)
xorder <- order(x)
sysm <- estvar[xorder]
lines(sx, sysm)
}
output <- "Done"
if (pyhat)
output <- estvar
output
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.