medcipb:

Usage Arguments Examples

Usage

1
medcipb(x, alpha = 0.05, null.val = NA, nboot = 500, SEED = TRUE, ...)

Arguments

x
alpha
null.val
nboot
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
##---- 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, alpha = 0.05, null.val = NA, nboot = 500, SEED = TRUE, 
    ...) 
{
    x <- elimna(x)
    if (SEED) 
        set.seed(2)
    data <- matrix(sample(x, size = length(x) * nboot, replace = TRUE), 
        nrow = nboot)
    bvec <- apply(data, 1, median)
    test <- NULL
    if (!is.na(null.val)) {
        tv <- sum(bvec == null.val)/nboot
        test <- sum(bvec > null.val)/nboot + 0.5 * tv
        if (test > 0.5) 
            test <- 1 - test
        test <- 2 * test
    }
    bvec <- sort(bvec)
    icl <- round(alpha * nboot/2) + 1
    icu <- nboot - icl - 1
    cilow <- bvec[icl]
    ciup <- bvec[icu]
    list(ci.low = cilow, ci.up = ciup, p.value = test)
  }

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