DEPancpb:

Usage Arguments Examples

Usage

1
DEPancpb(x1, y1, y2, fr1 = 1, est = tmean, alpha = 0.05, plotit = TRUE, DISDIF = FALSE, DIF = TRUE, TLS = FALSE, SEED = TRUE, pts = NULL, sm = FALSE, xout = FALSE, outfun = out, nboot = 500, pr = FALSE, na.rm = TRUE, xlab = "Group 1", ylab = "Group 2", ...)

Arguments

x1
y1
y2
fr1
est
alpha
plotit
DISDIF
DIF
TLS
SEED
pts
sm
xout
outfun
nboot
pr
na.rm
xlab
ylab
...

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
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
##---- 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 (x1, y1, y2, fr1 = 1, est = tmean, alpha = 0.05, plotit = TRUE, 
    DISDIF = FALSE, DIF = TRUE, TLS = FALSE, SEED = TRUE, pts = NULL, 
    sm = FALSE, xout = FALSE, outfun = out, nboot = 500, pr = FALSE, 
    na.rm = TRUE, xlab = "Group 1", ylab = "Group 2", ...) 
{
    m = cbind(x1, y1, y2)
    flag = is.na(x1)
    if (na.rm) 
        m = elimna(m)
    if (!na.rm) {
        m = m[!flag, ]
    }
    x1 = m[, 1]
    y1 = m[, 2]
    y2 = m[, 3]
    if (is.null(pts[1])) {
        npt <- 5
        isub <- c(1:5)
        test <- c(1:5)
        xorder <- order(x1)
        y1 <- y1[xorder]
        x1 <- x1[xorder]
        y2 <- y2[xorder]
        vecn <- 1
        for (i in 1:length(x1)) vecn[i] <- length(y1[near(x1, 
            x1[i], fr1)])
        sub <- c(1:length(x1))
        isub[1] <- min(sub[vecn >= 12])
        isub[5] <- max(sub[vecn >= 12])
        isub[3] <- floor((isub[1] + isub[5])/2)
        isub[2] <- floor((isub[1] + isub[3])/2)
        isub[4] <- floor((isub[3] + isub[5])/2)
    }
    if (!is.null(pts[1])) 
        isub = c(1:length(pts))
    mat <- matrix(NA, length(isub), 6)
    dimnames(mat) <- list(NULL, c("X", "n", "DIF", "ci.low", 
        "ci.hi", "p.value"))
    for (i in 1:length(isub)) {
        if (is.null(pts)) {
            ch = near(x1, x1[isub[i]], fr1)
            mat[i, 1] = x1[isub[i]]
        }
        if (!is.null(pts)) {
            ch = near(x1, pts[i], fr1)
            mat[i, 1] = pts[i]
        }
        mat[i, 2] = sum(ch)
        if (!DISDIF) {
            if (!DIF) {
                if (!TLS) {
                  test = rmmismcp(m[ch, 2], m[ch, 3], alpha = alpha, 
                    SEED = SEED, est = est, plotit = FALSE, grp = grp, 
                    nboot = 500, xlab = xlab, ylab = ylab, pr = pr, 
                    ...)
                  mat[i, 3] = est(m[ch, 2], na.rm = TRUE) - est(m[ch, 
                    3], na.rm = TRUE)
                  mat[i, 4] <- test$output[1, 6]
                  mat[i, 5] <- test$output[1, 7]
                  mat[i, 6] <- test$output[1, 4]
                }
                if (TLS) {
                  test = rm2miss(m[ch, 2], m[ch, 3], nboot = nboot, 
                    alpha = alpha, SEED = SEED)
                  mat[i, 3] = mean(m[ch, 2], na.rm = TRUE) - 
                    mean(m[ch, 3], na.rm = TRUE)
                  mat[i, 4] <- test$ci[1]
                  mat[i, 5] <- test$ci[2]
                  mat[i, 6] <- test$p.value
                }
            }
            if (DIF) {
                test = onesampb(m[ch, 2] - m[ch, 3], est = est, 
                  nboot = nboot, alpha = alpha, SEED = SEED, 
                  ...)
                mat[i, 3] = est(m[ch, 2] - m[ch, 3], na.rm = TRUE, 
                  ...)
                mat[i, 4] <- test$ci[1]
                mat[i, 5] <- test$ci[2]
                mat[i, 6] <- test$p.value
            }
        }
        if (DISDIF) {
            test = l2drmci(m[ch, 2:3], pr = FALSE, nboot = nboot, 
                na.rm = na.rm)
            mat[i, 3] <- loc2dif(m[ch, 2], m[ch, 3], na.rm = na.rm)
            mat[i, 4] <- test$ci[1]
            mat[i, 5] <- test$ci[2]
            mat[i, 6] <- test$p.value
        }
    }
    if (plotit) 
        runmean2g(x1, y1, x1, y2, fr = fr1, est = est, sm = sm, 
            xout = xout, outfun = outfun, ...)
    list(output = mat)
  }

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