1 |
x |
|
y |
|
op |
|
op2 |
|
tr |
|
plotit |
|
xlab |
|
ylab |
|
zlab |
|
est |
|
sm |
|
SEED |
|
xout |
|
outfun |
|
... |
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 70 71 72 73 74 75 76 77 78 79 | ##---- 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, op = 1, op2 = FALSE, tr = 0.2, plotit = TRUE,
xlab = "NA", ylab = "NA", zlab = "ABS(res)", est = median,
sm = FALSE, SEED = TRUE, xout = FALSE, outfun = outpro, ...)
{
x <- as.matrix(x)
p <- ncol(x)
pp <- p + 1
xy <- elimna(cbind(x, y))
x <- xy[, 1:p]
y <- xy[, pp]
x <- as.matrix(x)
if (xout) {
m <- cbind(x, y)
flag <- outfun(x, plotit = FALSE, ...)$keep
m <- m[flag, ]
x <- m[, 1:p]
y <- m[, pp]
x <- as.matrix(x)
}
output <- NA
if (ncol(x) == 1) {
if (!op2)
res <- y - runhat(x, y, est = est, pts = x)
if (op2)
res <- y - est(y)
if (op == 1)
output <- regci(x, abs(res), SEED = SEED, pr = FALSE)$regci[2,
5]
if (op == 2)
output <- wincorci(x, abs(res), tr = tr, SEED = SEED)$p.value
if (op == 3)
output <- indt(x, abs(res), SEED = SEED)$p.value.d
}
if (ncol(x) > 1) {
pv <- ncol(x) + 1
if (!op2)
res <- y - rung3hat(x, y, est = est, pts = x)$rmd
if (op2)
res <- y - est(y)
if (op == 1)
output <- regci(x, abs(res), pr = FALSE)$regci[2:pv,
5]
if (op == 2)
output <- winall(cbind(x, abs(res)), tr = tr)$p.values[1:ncol(x),
pv]
if (op == 3)
output <- indt(x, abs(res), SEED = SEED)$p.value.d
}
if (plotit) {
if (ncol(x) == 1) {
if (xlab == "NA")
xlab = "X"
if (ylab == "NA")
ylab = "ABS(res)"
if (!sm)
rungen(x, abs(res), est = est, xlab = xlab, ylab = ylab)
if (sm)
runmbo(x, abs(res), est = est, xlab = xlab, ylab = ylab)
}
if (ncol(x) == 2) {
if (xlab == "NA")
xlab = "X1"
if (ylab == "NA")
ylab = "X2"
if (sm)
rung3d(x, abs(res), est = est, xlab = xlab, ylab = ylab,
zlab = zlab)
if (!sm)
run3bo(x, abs(res), est = est, xlab = xlab, ylab = ylab,
zlab = zlab)
}
}
list(p.value = output)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.