esfun:

Usage Arguments Examples

Usage

1
esfun(x, tr = 0.2, nboot = 100, SEED = TRUE)

Arguments

x
tr
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
42
43
44
##---- 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, tr = 0.2, nboot = 100, SEED = TRUE) 
{
    if (is.data.frame(x)) 
        x = as.matrix(x)
    if (SEED) 
        set.seed(2)
    if (is.matrix(x)) 
        x <- listm(x)
    J <- length(x)
    xbar = NA
    nval = NA
    pts = NULL
    for (j in 1:J) {
        nval[j] = length(x[[j]])
        xbar[j] <- mean(x[[j]], tr = tr)
    }
    pts = pool.a.list(x)
    chkn = var(nval)
    if (chkn == 0) {
        top = var(xbar)
        bot = winvarN(pts, tr = tr)
        e.pow = top/bot
    }
    if (chkn != 0) {
        if (SEED) 
            set.seed(2)
        vals = 0
        N = min(nval)
        xdat = list()
        for (i in 1:nboot) {
            for (j in 1:J) {
                xdat[[j]] = sample(x[[j]], N)
                vals[i] = t1way.effect(xdat, tr = tr)$Var.Explained
            }
        }
        e.pow = mean(vals)
    }
    list(Effect.Size = sqrt(e.pow))
  }

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