1 |
x1 |
|
y1 |
|
x2 |
|
y2 |
|
regfun |
|
xlab |
|
ylab |
|
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 34 35 | ##---- 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 (x1, y1, x2, y2, regfun = tsreg, xlab = "X", ylab = "Y",
xout = FALSE, outfun = out, STAND = TRUE, ...)
{
xy = elimna(cbind(x1, y1))
x1 = xy[, 1]
y1 = xy[, 2]
xy = elimna(cbind(x2, y2))
x2 = xy[, 1]
y2 = xy[, 2]
if (xout) {
flago = identical(outfun, out)
if (!flago)
flag = outfun(x1, plotit = FALSE)$keep
if (flago)
flag = outpro(x1, STAND = STAND, plotit = FALSE)$keep
x1 = x1[flag]
y1 = y1[flag]
if (!flago)
flag = outfun(x2, plotit = FALSE)$keep
if (flago)
flag = outpro(x2, STAND = STAND, plotit = FALSE)$keep
x2 = x2[flag]
y2 = y2[flag]
}
plot(c(x1, x2), c(y1, y2), type = "n", xlab = xlab, ylab = ylab)
points(x1, y1)
points(x2, y2, pch = "+")
abline(regfun(x1, y1, ...)$coef)
abline(regfun(x2, y2, ...)$coef, lty = 2)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.