corb:

Usage Arguments Examples

Usage

1
corb(x, y, corfun = pbcor, nboot = 599, alpha = 0.05, plotit = FALSE, xlab = "X", ylab = "Y", SEED = TRUE, ...)

Arguments

x
y
corfun
nboot
alpha
plotit
xlab
ylab
SEED
...

Examples

 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
##---- 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, corfun = pbcor, nboot = 599, alpha = 0.05, plotit = FALSE, 
    xlab = "X", ylab = "Y", SEED = TRUE, ...) 
{
    m1 = cbind(x, y)
    m1 <- elimna(m1)
    nval = nrow(m1)
    x <- m1[, 1]
    y <- m1[, 2]
    est <- corfun(x, y, ...)$cor
    if (SEED) 
        set.seed(2)
    data <- matrix(sample(length(y), size = length(y) * nboot, 
        replace = TRUE), nrow = nboot)
    bvec <- apply(data, 1, corbsub, x, y, corfun, ...)
    ihi <- floor((1 - alpha/2) * nboot + 0.5)
    ilow <- floor((alpha/2) * nboot + 0.5)
    bsort <- sort(bvec)
    corci <- 1
    corci[1] <- bsort[ilow]
    corci[2] <- bsort[ihi]
    phat <- sum(bvec < 0)/nboot
    sig <- 2 * min(phat, 1 - phat)
    if (plotit) 
        outpro(cbind(x, y), xlab = xlab, ylab = ylab, plotit = TRUE)
    list(cor.ci = corci, p.value = sig, cor.est = est)
  }

musto101/wilcox_R documentation built on May 23, 2019, 10:52 a.m.