mlrreg.Stest:

Usage Arguments Examples

Usage

1
mlrreg.Stest(x, y, nboot = 100, SEED = TRUE)

Arguments

x
y
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
##---- 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, nboot = 100, SEED = TRUE) 
{
    if (SEED) 
        set.seed(2)
    est = as.vector(mlrreg(x, y)$coef[-1, ])
    n = nrow(x)
    JK = ncol(x) * ncol(y)
    vals = matrix(0, nrow = nboot, ncol = JK)
    for (i in 1:nboot) {
        bsam = sample(n, replace = TRUE)
        vals[i, ] = as.vector(mlrreg(x[bsam, ], y[bsam, ])$coef[-1, 
            ])
    }
    Sv = cov(vals)
    est = as.matrix(est)
    k = 1/JK
    test <- k * crossprod(est, solve(Sv, est))[1, ]
    v1 = JK - 1
    v2 = n - JK
    pval = 1 - pf(test, v1, v2)
    list(test.stat = test, p.value = pval, est = est)
  }

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