TWOpNOVPV:

Usage Arguments Examples

Usage

1
TWOpNOVPV(x, y, HC4 = TRUE, alpha = 0.05)

Arguments

x
y
HC4
alpha

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
##---- 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, HC4 = TRUE, alpha = 0.05) 
{
    alph <- c(1:99)/100
    for (i in 1:99) {
        irem <- i
        chkit <- TWOpNOV(x, y, alpha = alph[i], HC4 = TRUE)
        chkit = c(chkit$ci.lower, chkit$ci.upper)
        if (sign(chkit[1] * chkit[2]) == 1) 
            break
    }
    p.value <- irem/100
    if (p.value <= 0.1) {
        iup <- (irem + 1)/100
        alph <- seq(0.001, iup, 0.001)
        for (i in 1:length(alph)) {
            p.value <- alph[i]
            alph <- c(1:99)/100
            for (i in 1:99) {
                irem <- i
                chkit <- TWOpNOV(x, y, alpha = alph[i], HC4 = TRUE)
                chkit = c(chkit$ci.lower, chkit$ci.upper)
                if (sign(chkit[1] * chkit[2]) == 1) 
                  break
            }
        }
    }
    p.value <- irem/100
    if (p.value <= 0.1) {
        iup <- (irem + 1)/100
        alph <- seq(0.001, iup, 0.001)
        for (i in 1:length(alph)) {
            p.value <- alph[i]
            chkit <- TWOpNOV(x, y, alpha = alph[i], HC4 = TRUE)
            chkit = c(chkit$ci.lower, chkit$ci.upper)
            if (sign(chkit[1] * chkit[2]) == 1) 
                break
        }
    }
    if (p.value <= 0.001) {
        alph <- seq(1e-04, 0.001, 1e-04)
        for (i in 1:length(alph)) {
            p.value <- alph[i]
            chkit <- TWOpNOV(x, y, alpha = alph[i], HC4 = TRUE)
            chkit = c(chkit$ci.lower, chkit$ci.upper)
            if (sign(chkit[1] * chkit[2]) == 1) 
                break
        }
    }
    if (p.value <= 0.001) {
        alph <- seq(1e-04, 0.001, 1e-04)
        for (i in 1:length(alph)) {
            p.value <- alph[i]
            chkit <- TWOpNOV(x, y, alpha = alph[i], HC4 = TRUE)
            chkit = c(chkit$ci.lower, chkit$ci.upper)
            if (sign(chkit[1] * chkit[2]) == 1) 
                break
        }
    }
    res = TWOpNOV(x, y, alpha = alpha, HC4 = TRUE)
    ci = c(res$ci.lower, res$ci.upper)
    list(p.value = p.value, est.1 = res$est.1, est.2 = res$est.2, 
        ci = ci)
  }

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