rStats.js v1.3.0
    Preparing search index...

    Function phyper

    • Distribution function of the hypergeometric distribution (number of white balls among k drawn without replacement from an urn of m white and n black balls). Equivalent to R's phyper(q, m, n, k, lower.tail = TRUE, log.p = FALSE).

      Type Parameters

      Parameters

      • q: T

        Quantile(s): a number, number[] or Float64Array. The result has the same shape.

      • m: number

        Number of white balls in the urn.

      • n: number

        Number of black balls in the urn.

      • k: number

        Number of balls drawn.

      • options: TailOptions = {}

        lowerTail and logP (see TailOptions).

      Returns VectorResult<T>

      The probability (or log probability).

      phyper(2, 10, 7, 8);                       // 0.013368983957219256
      phyper(5, 10, 7, 8, { lowerTail: false }); // 0.21781160016454126