1 | Qdepthcomsub(x1, y1, x2, y2, qval)
|
x1 |
|
y1 |
|
x2 |
|
y2 |
|
qval |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ##---- 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, qval)
{
x1 = (x1 - median(x1))/mad(x1)
x2 = (x2 - median(x2))/mad(x2)
yh1 = qsmcobs(x1, y1, FIT = FALSE, qval = qval, plotit = FALSE)$yhat
temp2 = cobs(x2, y2, print.mesg = FALSE, print.warn = FALSE,
tau = qval)
yh2 = predict(temp2, z = x1)
yh2 = yh2[, 2]
flag = is.na(yh2)
res1 = y1 - yh1
res2 = y1[!flag] - yh2[!flag]
dep1 = resdepth(x1, res1)
dep2 = resdepth(x1[!flag], res2)
list(dep1 = dep1, dep2 = dep2)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.