mHG.test {mHG} | R Documentation |
Perform Minimum-Hypergeometric test.
Description
Performs a minimum-hypergeometric (mHG) test. The null-hypothesis is that provided list was randomly and equiprobable selected from all lists containing N entries, B of which are 1s. The alternative hypothesis is that the 1s tend to appear at the top of the list.
Usage
mHG.test(lambdas, n_max = length(lambdas))
Arguments
lambdas |
|
n_max |
the algorithm will only consider the first |
Details
O(NB)
running time, O(NB)
space.
Value
A list with class "htest" containing the following components:
statistic |
The mHG statistic. |
p.value |
The p-value for the test. |
parameters |
|
n |
The index for which the mHG was obtained (smallest one if several n give the same mHG). |
b |
|
Author(s)
Kobi Perl
References
Eden, E. (2007). Discovering Motifs in Ranked Lists of DNA Sequences. Haifa. Retrieved from http://bioinfo.cs.technion.ac.il/people/zohar/thesis/eran.pdf (pages 10-12, 18-20)
Examples
N <- 50
B <- 15
lambdas <- numeric(50)
lambdas[sample(N, B)] <- 1
t <- mHG.test(lambdas)
t <- mHG.test(lambdas, n_max = 20)