discANOVA:

Usage Arguments Examples

Usage

1
discANOVA(x, nboot = 500, SEED = TRUE)

Arguments

x
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
30
31
32
33
34
35
36
37
38
39
40
41
##---- 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, nboot = 500, SEED = TRUE) 
{
    if (is.matrix(x) || is.data.frame(x)) 
        x = listm(x)
    library(mc2d)
    if (SEED) 
        set.seed(2)
    vals = lapply(x, unique)
    vals = sort(elimna(list2vec(vals)))
    K = length(unique(vals))
    n = lapply(x, length)
    n = list2vec(n)
    J = length(x)
    step1 = discANOVA.sub(x)
    test = step1$test
    C1 = step1$C1
    HT = NULL
    for (i in 1:K) HT[i] = mean(C1[i, ])
    tv = NULL
    TB = NA
    VP = NA
    B1hat = NA
    xx = list()
    for (ib in 1:nboot) {
        xx = list()
        for (j in 1:J) {
            temp = rmultinomial(n[j], 1, HT)
            xx[[j]] = which(temp[1, ] == 1)
            for (i in 2:n[j]) xx[[j]][i] = which(temp[i, ] == 
                1)
        }
        TB[ib] = discANOVA.sub(xx)$test
    }
    pv = 1 - mean(test > TB) - 0.5 * mean(test == TB)
    list(test = test, p.value = pv)
  }

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