Computes enrichment (log-scale), standard error and p-value

compute_enrichment_test(
  group_prior,
  group_size,
  enrichment_test = c("fisher", "G", "z"),
  alternative = c("greater", "two.sided", "less"),
  include_test_result = FALSE
)

Arguments

group_prior

a vector of prior inclusion probabilities for different groups.

group_size

a vector of number of variables in different groups.

enrichment_test

Method to test enrichment, "G": G-test, "fisher": Fisher's exact test, "z": p-value computed from z-score of enrichment.

alternative

indicates the alternative hypothesis and must be one of "greater", "two.sided", or "less". Only used when enrichment_test is "fisher" or "z".

include_test_result

If TRUE, return the original test result.

Value

Estimated enrichment, S.E. and p-value from G-test or Fisher's exact test.