Description Usage Arguments See Also Examples
Plot the results of the minimum hypergeometric test.
1 2 | plot_mhg(values, x, res, n = 500, main = "", value = "Value", cex = 1.5,
cex.lab = 1.5, cex.axis = 1.5, cex.main = 2)
|
values |
The values corresponding to the ranked vector. |
x |
A binary vector of successes and failures. |
res |
A list returned by mhg_test. |
n |
Plot the first n items in the list. |
main |
The title of the plot. |
value |
The name of the value used to rank the items. |
cex |
The relative size of the legend text. |
cex.lab |
The relative size of the axis labels. |
cex.axis |
The relative size of the axis tickmarks. |
cex.main |
The relative size of the title. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # Size of the population.
N <- 5000L
# Successes in the population.
K <- 100L
# Only consider enrichments in the first L observations.
L <- N / 4L
# Require at least X successes in the first L observations.
X <- 5L
set.seed(42)
# Binary vector of successes and failures.
x <- rep(0, N)
x[sample(100, 5)] <- 1
x[sample(200, 10)] <- 1
res <- mhg_test(x, N, K, L, X)
abs(res$pvalue - 1.810658e-05) < 1e-6 # TRUE
# Plot the result.
plot_mhg(sort(rnorm(N)), x, res, L)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.