enrichment.test: Enrichment test

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/utility-methods.R

Description

Statistical enrichment analysis using either a Hypergeometric or Fisher's test

Usage

1
2
3
4
5
6
7
enrichment.test(
  sample_true,
  sample_size,
  pop_true,
  pop_size,
  method = c("fisher", "hyper")
)

Arguments

sample_true

Number of hits in sample

sample_size

Size of sample

pop_true

Number of hits in population

pop_size

Size of population

method

Statistical method that should be used

Details

Hypergeometric or one-tailed Fisher exact test is useful for enrichment analyses. For example, one needs to estimate which features are enriched among a set of instances sampled from a population.

Value

A list containing the following components:

p.value

P-value of the test

odds.ratio

Odds ratio

conf.int

Confidence interval for the odds ratio (only shown with method="fisher")

method

Used statistical test

Author(s)

Daniel C. Ellwanger

See Also

Hypergeometric and fisher.test

Examples

1
2
3
4
5
# Population has 13 of total 52 instances positive for a given feature
# Sample has 1 of total 5 instances positive for a given feature
# Test for significance of enrichment in sample
enrichment.test(sample_true=1, sample_size=5,
                pop_true=13, pop_size=52, method="fisher")

elldc/CellTrails documentation built on May 16, 2020, 4:40 a.m.