1 |
x |
|
y |
|
plotit |
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 | ##---- 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 = NA, plotit = FALSE)
{
if (!is.na(y[1]))
x <- cbind(x, y)
x <- elimna(x)
n <- nrow(x)
keep <- outtbs(x, plotit = plotit)$keep
val <- cor(x[keep, ])
p.value <- NA
test <- NA
crit.05 <- 30.41/n + 2.21
vat <- val
diag(vat) <- 0
test <- abs(vat * sqrt((n - 2)/(1 - vat^2)))
diag(test) <- NA
if (ncol(val) == 2) {
p.value <- c("Greater than .1")
val <- val[1, 2]
test <- abs(val * sqrt((n - 2)/(1 - val^2)))
p.value <- c("Greater than .1")
crit <- 20.2/n + 1.89
if (test >= crit)
p.value <- c("Less than .1")
crit <- 30.41/n + 2.21
if (test >= crit)
p.value <- c("Less than .05")
crit <- 39.72/n + 2.5
if (test >= crit)
p.value <- c("Less than .025")
crit <- 58.55/n + 2.8
if (test >= crit)
p.value <- c("Less than .01")
}
list(cor = val, test.stat = test, p.value = p.value, crit.05 = crit.05)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.