Hypergeometric.test: Hypergeometric.test

View source: R/Hypergeometric.R

Hypergeometric.testR Documentation

Hypergeometric.test

Description

Calculates the significance of an overlap of two sets using an hypergeometric test. It is a wrapper of the 'phyper' function.

Usage

Hypergeometric.test(
  success,
  universe_success,
  universe_failure,
  size_collected,
  lower.tail = FALSE
)

Arguments

success

Is the number of elements in the overlap of the sets.

universe_success

Is the number of elements of the set of interest.

universe_failure

Is the number of elements of the set of the other set.

size_collected

The total of elements in the universe

lower.tail

Should the test be calculated on the lower tail? (Hypothesis test is lower than)

Value

the p-value for the hypergeometric test.

Examples

require(magrittr)
s = 10; S = 15; f = 10; T = 30
Hypergeometric.test(success = s,
universe_success = S,
universe_failure = f,
size_collected = T
)

NetSci documentation built on July 4, 2022, 1:05 a.m.