hyper2binomP: Transform Hypergeometric Distribution Parameters to Binomial...

View source: R/hyper-dist.R

hyper2binomPR Documentation

Transform Hypergeometric Distribution Parameters to Binomial Probability

Description

Transform the three parameters of the hypergeometric distribution function to the probability parameter of the “corresponding” binomial distribution.

Usage

hyper2binomP(x, m, n, k)

Arguments

x, m, n, k

see dhyper.

Value

a number, the binomial probability.

References

See those in phyperBinMolenaar.

See Also

phyper, pbinom.

dhyperBinMolenaar(), phyperBinMolenaar.1(), *.2(), etc, all of which are crucially based on hyper2binomP().

Examples

hyper2binomP(3,4,5,6) # 0.38856

## The function is simply defined as
function (x, m, n, k) {
    N <- m + n
    p <- m/N
    N.n <- N - (k - 1)/2
    (m - x/2)/N.n - k * (x - k * p - 1/2)/(6 * N.n^2)
 }

DPQ documentation built on Nov. 3, 2023, 5:07 p.m.