Learn R Programming

DPQ (version 0.5-3)

hyper2binomP: 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)

Value

a number, the binomial probability.

Arguments

x

..

m

..

n

..

k

..

Details

. . .

See Also

phyper, pbinom.

dhyperBinMolenaar() which is based on hyper2binomP().

Examples

Run this code
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)
  }

Run the code above in your browser using DataLab