bwbmcp:

Usage Arguments Examples

Usage

1
bwbmcp(J, K, x, tr = 0.2, JK = J * K, grp = c(1:JK), con = 0, alpha = 0.05, dif = TRUE, pool = FALSE)

Arguments

J
K
x
tr
JK
grp
con
alpha
dif
pool

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
##---- 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 (J, K, x, tr = 0.2, JK = J * K, grp = c(1:JK), con = 0, 
    alpha = 0.05, dif = TRUE, pool = FALSE) 
{
    if (is.matrix(x)) {
        y <- list()
        for (j in 1:ncol(x)) y[[j]] <- x[, j]
        x <- y
    }
    JK <- J * K
    data <- list()
    for (j in 1:length(x)) {
        data[[j]] <- x[[grp[j]]]
    }
    x <- data
    if (pool) {
        data <- list()
        m1 <- matrix(c(1:JK), J, K, byrow = T)
        for (k in 1:K) {
            for (j in 1:J) {
                flag <- m1[j, k]
                print(paste("Level", j, "factor A:"))
                if (j == 1) 
                  temp <- x[[flag]]
                if (j > 1) {
                  temp <- c(temp, x[[flag]])
                }
            }
            data[[k]] <- temp
        }
        print("Group numbers refer to levels of Factor B")
        temp <- rmmcp(data, con = con, tr = tr, alpha = alpha, 
            dif = dif)
        return(temp)
    }
    if (!pool) {
        mat <- matrix(c(1:JK), ncol = K, byrow = T)
        for (j in 1:J) {
            data <- list()
            ic <- 0
            for (k in 1:K) {
                ic <- ic + 1
                data[[ic]] <- x[[mat[j, k]]]
            }
            print(paste("For level ", j, " of Factor A:"))
            temp <- rmmcp(data, con = con, tr = tr, alpha = alpha, 
                dif = dif)
            print(temp$test)
            print(temp$psihat)
        }
    }
  }

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