pvalchyper: P-values from a conditional hypergeometric distribution

Description Usage Arguments Value Examples

View source: R/chyper.R

Description

Calculates p-values from a conditional hypergeometric distribution: the distribution of how many items are in the overlap of all samples when samples of arbitrary size are each taken without replacement from populations of arbitrary size.

Usage

1
pvalchyper(k, s, n, m, tail = "upper", verbose = T)

Arguments

k

an integer or vector of integers representing the overlap size

s

an integer representing the size of the intersecting population

n

a vector of integers representing the sizes of each non-intersecting population

m

a vector of integers representing the sample sizes

tail

whether the p-value should be from the upper or lower tail (options: "upper", "lower")

verbose

T/F should intermediate messages be printed?

Value

The probability of getting the k or more (or less if tail="lower") overlaps by chance from the conditional hypergeometric distribution specified by the parameters

Examples

1
pvalchyper(c(1,2), 8, c(12,13,14), c(7,8,9), "upper")

chyper documentation built on Aug. 13, 2021, 5:09 p.m.