1 |
x |
|
y |
|
corfun |
|
gval |
|
plotit |
|
op |
|
cop |
|
xlab |
|
ylab |
|
STAND |
|
pr |
|
SEED |
|
MC |
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 | ##---- 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 = NULL, corfun = pcor, gval = NA, plotit = FALSE,
op = TRUE, cop = 3, xlab = "VAR 1", ylab = "VAR 2", STAND = TRUE,
pr = TRUE, SEED = TRUE, MC = FALSE)
{
if (SEED) {
oldSeed <- .Random.seed
set.seed(12)
}
if (is.null(y[1]))
m <- x
if (!is.null(y[1]))
m <- cbind(x, y)
m <- elimna(m)
if (!MC)
temp <- outpro(m, gval = gval, plotit = plotit, op = op,
cop = cop, xlab = xlab, ylab = ylab, STAND = STAND,
pr = pr)$keep
if (MC)
temp <- outproMC(m, gval = gval, plotit = plotit, op = op,
cop = cop, xlab = xlab, ylab = ylab, STAND = STAND,
pr = pr)$keep
tcor <- corfun(m[temp, ])$cor
if (!is.null(dim((m))))
tcor <- tcor[1, 2]
test <- abs(tcor * sqrt((nrow(m) - 2)/(1 - tcor^2)))
if (ncol(m) != 2)
diag(test) <- NA
crit <- 6.947/nrow(m) + 2.3197
if (SEED) {
assign(x = ".Random.seed", value = oldSeed, envir = .GlobalEnv)
}
list(cor.value = tcor, test.stat = test, crit.05 = crit)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.