1 |
n1 |
|
n2 |
|
regfun |
|
nreps |
|
alpha |
|
MC |
|
SEED |
|
cov1 |
|
DEEP |
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 | ##---- 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 (n1, n2, regfun = qreg, nreps = 1000, alpha = 0.05,
MC = FALSE, SEED = TRUE, cov1 = TRUE, DEEP = TRUE)
{
if (MC)
library(parallel)
if (SEED)
set.seed(2)
x = list()
n = max(c(n1, n2))
nmiss = n - min(c(n1, n2))
for (i in 1:nreps) {
x[[i]] = rmul(n, p = 6)
if (n1 < n2) {
if (nmiss > 0)
x[[i]][1:nmiss, 1:3] = NA
}
if (n1 > n2) {
if (nmiss > 0)
x[[i]][1:nmiss, 4:6] = NA
}
}
if (!MC)
vals = lapply(x, ancJNmpcp.sub, regfun = regfun, cov1 = cov1,
DEEP = DEEP)
if (MC)
vals = mclapply(x, ancJNmpcp.sub, regfun = regfun, cov1 = cov1,
DEEP = DEEP)
vals = as.vector(matl(vals))
pc.est = hd(vals, alpha)
list(pc.est = pc.est)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.