mHG.pval.calc {mHG} | R Documentation |
Calculate the p-value of a minimum-hypergeometric (mHG) statistic.
Description
Calculates the p-value associated with the (minimum-hypergeometric) mHG statistic.
Usage
mHG.pval.calc(p, N, B, n_max = N)
Arguments
p |
the mHG statistic. It is marked as p as it represents an "uncorrected" p-value. |
N |
total number of white and black balls (according to the hypergeometric problem definition). |
B |
number of black balls. |
n_max |
the algorithm will calculate the p-value under the assumption that only the
first |
Details
O(NB)
running time, O(NB)
space.
Value
the p-value of the test.
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 11-12, 19-20)
Examples
N <- 50
B <- 15
lambdas <- numeric(50)
lambdas[sample(N, B)] <- 1
p <- mHG.statistic.calc(lambdas)@mHG
p.corrected <- mHG.pval.calc(p, N, B) # Could have used mHG.test directly
[Package mHG version 1.1 Index]