ancGLOB_sub3:

Usage Arguments Examples

Usage

1
ancGLOB_sub3(x1, y1, x2, y2, xout = FALSE, outfun = outpro, est = tmean, pcrit = NULL, p.crit = NULL, iter = 100, nboot = 500, SEED = TRUE, MC = FALSE, nmin = 12, pts = NULL, fr1 = 1, fr2 = 1, plotit = TRUE, xlab = "X", ylab = "Y", LP = TRUE, ...)

Arguments

x1
y1
x2
y2
xout
outfun
est
pcrit
p.crit
iter
nboot
SEED
MC
nmin
pts
fr1
fr2
plotit
xlab
ylab
LP
...

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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
##---- 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 (x1, y1, x2, y2, xout = FALSE, outfun = outpro, est = tmean, 
    pcrit = NULL, p.crit = NULL, iter = 100, nboot = 500, SEED = TRUE, 
    MC = FALSE, nmin = 12, pts = NULL, fr1 = 1, fr2 = 1, plotit = TRUE, 
    xlab = "X", ylab = "Y", LP = TRUE, ...) 
{
    if (SEED) 
        set.seed(2)
    x1 <- as.matrix(x1)
    p1 <- ncol(x1) + 1
    p <- ncol(x1)
    if (p > 1) 
        stop("Current version is for one independent variable only")
    xy <- cbind(x1, y1)
    xy <- elimna(xy)
    x1 <- xy[, 1:p]
    y1 <- xy[, p1]
    xy <- cbind(x2, y2)
    xy <- elimna(xy)
    x2 <- xy[, 1:p]
    y2 <- xy[, p1]
    if (xout) {
        m <- cbind(x1, y1)
        flag <- outfun(x1, plotit = FALSE, ...)$keep
        m <- m[flag, ]
        x1 <- m[, 1:p]
        y1 <- m[, p1]
        m <- cbind(x2, y2)
        flag <- outfun(x2, plotit = FALSE, ...)$keep
        m <- m[flag, ]
        x2 <- m[, 1:p]
        y2 <- m[, p1]
    }
    N1 = length(y1)
    N2 = length(y2)
    if (is.null(pts[1])) {
        isub <- c(1:5)
        test <- c(1:5)
        xorder <- order(x1)
        y1 <- y1[xorder]
        x1 <- x1[xorder]
        xorder <- order(x2)
        y2 <- y2[xorder]
        x2 <- x2[xorder]
        n1 <- 1
        n2 <- 1
        vecn <- 1
        for (i in 1:length(x1)) n1[i] <- length(y1[near(x1, x1[i], 
            fr1)])
        for (i in 1:length(x1)) n2[i] <- length(y2[near(x2, x1[i], 
            fr2)])
        for (i in 1:length(x1)) vecn[i] <- min(n1[i], n2[i])
        sub <- c(1:length(x1))
        isub[1] <- min(sub[vecn >= nmin])
        isub[5] <- max(sub[vecn >= nmin])
        isub[3] <- floor((isub[1] + isub[5])/2)
        isub[2] <- floor((isub[1] + isub[3])/2)
        isub[4] <- floor((isub[3] + isub[5])/2)
        pts = x1[isub]
        g1 = list()
        g2 = list()
        for (i in 1:5) {
            g1[[i]] <- y1[near(x1, x1[isub[i]], fr1)]
            g2[[i]] <- y2[near(x2, x1[isub[i]], fr2)]
        }
    }
    if (!is.null(pts[1])) {
        if (length(pts) < 2) 
            stop("Should have at least two points (With one point, use the R function ancova)")
        g1 = list()
        g2 = list()
        for (i in 1:length(pts)) {
            g1[[i]] <- y1[near(x1, pts[i], fr1)]
            g2[[i]] <- y2[near(x2, pts[i], fr2)]
        }
    }
    n1 = lapply(g1, length)
    nv = (min(as.vector(matl(n1))))
    res = aov2depth(g1, g2, est = est, SEED = SEED, nboot = nboot, 
        ...)
    if (plotit) 
        runmean2g(x1, y1, x2, y2, nboot = nboot, fr = fr1, est = est, 
            xout = xout, LP = LP, ...)
    list(p.value = res$p.value, est1 = res$est1, est2 = res$est2, 
        dif = res$dif, pts = pts, n1 = res$n1, n2 = res$n2)
  }

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