regGmcp:

Usage Arguments Examples

Usage

1
regGmcp(x, y, regfun = tsreg, SEED = TRUE, nboot = 100, xout = FALSE, AD = FALSE, outfun = outpro, STAND = TRUE, alpha = 0.05, pr = TRUE, MC = FALSE, ISO = TRUE, ...)

Arguments

x
y
regfun
SEED
nboot
xout
AD
outfun
STAND
alpha
pr
MC
ISO
...

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
102
103
104
105
106
##---- 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, regfun = tsreg, SEED = TRUE, nboot = 100, xout = FALSE, 
    AD = FALSE, outfun = outpro, STAND = TRUE, alpha = 0.05, 
    pr = TRUE, MC = FALSE, ISO = TRUE, ...) 
{
    if (!is.list(x)) 
        stop("Argument x should have list mode")
    if (!is.list(y)) 
        stop("Argument y should have list mode")
    J = length(x)
    x = lapply(x, as.matrix)
    pchk = lapply(x, ncol)
    temp = matl(pchk)
    if (var(as.vector(temp)) != 0) 
        stop("Something is wrong. \nNumber of covariates differs among the groups being compared")
    nv = NULL
    p = ncol(x[[1]])
    p1 = p + 1
    for (j in 1:J) {
        xy = elimna(cbind(x[[j]], y[[j]]))
        x[[j]] = xy[, 1:p]
        y[[j]] = xy[, p1]
        x[[j]] = as.matrix(x[[j]])
        nv = c(nv, nrow(x[[j]]))
    }
    nv.keep = nv
    critrad = NULL
    if (!xout) {
        if (pr) 
            print("Might want to consider removing any leverage points")
    }
    if (xout) {
        temp = lapply(x, outfun, plotit = FALSE, STAND = STAND, 
            ...)
        for (j in 1:J) {
            x[[j]] = x[[j]][temp[[j]]$keep, ]
            y[[j]] = y[[j]][temp[[j]]$keep]
            nv.keep[j] = length(y[[j]])
        }
    }
    tot = (J^2 - J)/2
    dvec <- alpha/c(1:tot)
    outl = list()
    nr = tot * p1
    outp = matrix(NA, ncol = 5, nrow = tot)
    x = lapply(x, as.matrix)
    xx = list()
    yy = list()
    iall = 0
    ivp = c(1, tot) - tot
    i = 0
    for (j in 1:J) {
        for (k in 1:J) {
            if (j < k) {
                i = i + 1
                xx[[1]] = x[[j]]
                xx[[2]] = x[[k]]
                yy[[1]] = y[[j]]
                yy[[2]] = y[[k]]
                if (!ISO) {
                  if (!MC) 
                    all = reg1way(xx, yy, regfun = regfun, nboot = nboot, 
                      SEED = SEED, AD = TRUE, alpha = alpha, 
                      pr = FALSE, ...)
                  if (MC) 
                    all = reg1wayMC(xx, yy, regfun = regfun, 
                      nboot = nboot, SEED = SEED, AD = TRUE, 
                      alpha = alpha, pr = FALSE, ...)
                }
                if (ISO) {
                  if (!MC) 
                    all = reg1wayISO(xx, yy, regfun = regfun, 
                      nboot = nboot, SEED = SEED, AD = TRUE, 
                      alpha = alpha, pr = FALSE, ...)
                  if (MC) 
                    all = reg1wayISOMC(xx, yy, regfun = regfun, 
                      nboot = nboot, SEED = SEED, AD = TRUE, 
                      alpha = alpha, pr = FALSE, ...)
                }
                if (AD) 
                  temp = all$adjusted.p.value
                if (!AD) 
                  temp = all$p.value
                if (is.null(temp)) 
                  temp = all$p.value
                outp[i, 1] = j
                outp[i, 2] = k
                outp[i, 3] = temp
            }
        }
        temp2 <- order(0 - outp[, 3])
        icc = c(1:tot)
        icc[temp2] = dvec
        outp[, 4] = icc
    }
    flag = (outp[, 3] <= outp[, 4])
    outp[, 5] = rep(0, tot)
    outp[flag, 5] = 1
    dimnames(outp) = list(NULL, c("Group", "Group", "p.value", 
        "p.crit", "sig"))
    list(n = nv, n.keep = nv.keep, output = outp)
  }

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