hierBH: some title

Usage Arguments Examples

View source: R/hierBH.R

Usage

1
hierBH(pValues, alpha = 0.05)

Arguments

pValues
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
##---- 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 (pValues, alpha = 0.05) 
{
    result <- list()
    k <- length(pValues)
    flpvalues <- numeric()
    for (i in 1:k) {
        fpValues <- pValues[[i]]
        sortfpValues <- sort(fpValues)
        fm <- length(fpValues)
        interpValues <- numeric()
        for (i in 1:fm) {
            locpvalue <- (sortfpValues[[i]] * fm/i)
            interpValues <- c(interpValues, locpvalue)
        }
        flpvalues <- c(flpvalues, min(interpValues))
    }
    famlevel <- BH(flpvalues, alpha, silent = TRUE)$rejected
    for (i in 1:length(famlevel)) {
        R <- length(famlevel[famlevel[[i]] == TRUE])
        if (famlevel[[i]] == TRUE) {
            lresult <- BH(pValues[[i]], alpha = (R/k * alpha), 
                silent = TRUE)$rejected
        }
        else {
            lresult <- (pValues[[i]] != pValues[[i]])
        }
        result <- c(result, list(lresult))
    }
    return(result)
  }

WIAS-BERLIN/hierarchicalFDR documentation built on Dec. 30, 2019, 11:49 p.m.