q2by2:

Usage Arguments Examples

Usage

1
q2by2(x, q = c(0.1, 0.25, 0.5, 0.75, 0.9), nboot = 2000, SEED = TRUE)

Arguments

x
q
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
##---- 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, q = c(0.1, 0.25, 0.5, 0.75, 0.9), nboot = 2000, 
    SEED = TRUE) 
{
    if (SEED) 
        set.seed(2)
    if (is.matrix(x)) 
        x <- listm(x)
    if (length(x) != 4) 
        stop("Current version is for a 2-by-2 ANOVA only. Should have four groups.")
    A = matrix(NA, nrow = length(q), 5)
    B = matrix(NA, nrow = length(q), 5)
    AB = matrix(NA, nrow = length(q), 5)
    dimnames(A) = list(NULL, c("q", "psihat", "p.value", "ci.lower", 
        "ci.upper"))
    dimnames(B) = list(NULL, c("q", "psihat", "p.value", "ci.lower", 
        "ci.upper"))
    dimnames(AB) = list(NULL, c("q", "psihat", "p.value", "ci.lower", 
        "ci.upper"))
    con = con2way(2, 2)
    for (i in 1:length(q)) {
        A[i, 1] = q[i]
        B[i, 1] = q[i]
        AB[i, 1] = q[i]
        a = linconpb(x, nboot = nboot, est = hd, con = con$conA, 
            SEED = FALSE, q = q[i])
        b = linconpb(x, nboot = nboot, est = hd, con = con$conB, 
            SEED = FALSE, q = q[i])
        ab = linconpb(x, nboot = nboot, est = hd, con = con$conAB, 
            SEED = FALSE, q = q[i])
        A[i, 2:5] = a$output[, c(2, 3, 5, 6)]
        B[i, 2:5] = b$output[, c(2, 3, 5, 6)]
        AB[i, 2:5] = ab$output[, c(2, 3, 5, 6)]
    }
    list(A = A, B = B, AB = AB)
  }

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