bprm:

Usage Arguments Examples

Usage

1
bprm(x, y = NULL, grp = NA)

Arguments

x
y
grp

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
##---- 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 = NULL, grp = NA) 
{
    if (is.list(x)) 
        x <- matl(x)
    if (!is.null(y[1])) 
        x = cbind(x, y)
    x <- elimna(x)
    if (is.na(grp[1])) 
        grp <- c(1:ncol(x))
    if (!is.matrix(x)) 
        stop("Data are not stored in a matrix or in list mode.")
    K <- length(grp)
    Jb <- matrix(1, K, K)
    Ib <- diag(1, K)
    Pb <- Ib - Jb/K
    y <- matrix(rank(x), ncol = ncol(x))
    ybar <- apply(y, 2, mean)
    N <- ncol(x) * nrow(x)
    vhat <- var(y)/N^2
    test <- nrow(x) * sum((ybar - (N + 1)/2)^2)/N^2
    trval <- sum(diag(Pb %*% vhat))
    test <- test/trval
    nu1 <- trval^2/sum(diag(Pb %*% vhat %*% Pb %*% vhat))
    sig.level <- 1 - pf(test, nu1, 1e+06)
    list(test.stat = test, nu1 = nu1, p.value = sig.level)
  }

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