1 |
x |
|
y |
|
regfun |
|
xlab |
|
ylab |
|
zlab |
|
xout |
|
outfun |
|
theta |
|
phi |
|
ticktype |
|
... |
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, regfun = tsreg, xlab = "X", ylab = "Y", zlab = "Z",
xout = FALSE, outfun = out, theta = 50, phi = 25, ticktype = "simple",
...)
{
x = as.matrix(x)
if (ncol(x) > 2)
stop("One or two predictors only is allowed,")
p = ncol(x)
p1 = p + 1
if (xout) {
xy = cbind(x, y)
flag = outfun(x)$keep
x = xy[flag, 1:p]
y = xy[flag, p1]
}
if (p == 1) {
plot(x, y, xlab = xlab, ylab = ylab)
abline(regfun(x, y)$coef)
}
if (p == 2) {
pyhat = regYhat(x, y, regfun = regfun, ...)
temp = rplot(x, pyhat, scat = FALSE, theta = theta, phi = phi,
xlab = xlab, ylab = ylab, zlab = zlab, ticktype = ticktype,
pr = FALSE)
}
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.