1 |
x1 |
|
y1 |
|
x2 |
|
y2 |
|
regfun |
|
nboot |
|
SEED |
|
xout |
|
eout |
|
outfun |
|
STAND |
|
plotit |
|
xlab |
|
ylab |
|
ISO |
|
... |
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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | ##---- 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, nboot = 100, SEED = TRUE,
xout = FALSE, eout = FALSE, outfun = outpro, STAND = TRUE,
plotit = TRUE, xlab = "X", ylab = "Y", ISO = FALSE, ...)
{
x1 = as.matrix(x1)
p = ncol(x1)
p1 = p + 1
xy = elimna(cbind(x1, y1))
x1 = xy[, 1:p]
y1 = xy[, p1]
x2 = as.matrix(x2)
p = ncol(x2)
p1 = p + 1
xy = elimna(cbind(x2, y2))
x2 = xy[, 1:p]
y2 = xy[, p1]
if (plotit) {
xx1 = x1
yy1 = y1
xx2 = x2
yy2 = y2
if (ncol(as.matrix(x1)) == 1) {
if (eout) {
flag = outfun(cbind(x1, y1), plotit = FALSE,
...)$keep
xx1 = x1[flag]
yy1 = y1[flag]
flag = outfun(cbind(x2, y2), plotit = FALSE,
...)$keep
xx2 = x2[flag]
yy2 = y2[flag]
}
if (xout) {
flag = outfun(xx1, plotit = FALSE, ...)$keep
xx1 = x1[flag]
yy1 = y1[flag]
flag = outfun(xx2, plotit = FALSE, ...)$keep
xx2 = x2[flag]
yy2 = y2[flag]
}
plot(c(xx1, xx2), c(yy1, yy2), type = "n", xlab = xlab,
ylab = ylab)
points(xx1, yy1)
points(xx2, yy2, pch = "+")
abline(regfun(xx1, yy1, ...)$coef)
abline(regfun(xx2, yy2, ...)$coef, lty = 2)
}
}
x = list()
y = list()
x[[1]] = x1
x[[2]] = x2
y[[1]] = y1
y[[2]] = y2
if (!ISO)
output = reg1wayMC(x, y, regfun = regfun, nboot = nboot,
xout = xout, outfun = outfun, SEED = SEED, STAND = STAND,
...)
if (ISO)
output = reg1wayISOMC(x, y, regfun = regfun, nboot = nboot,
xout = xout, outfun = outfun, SEED = SEED, STAND = STAND,
...)
output
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.