dnoncenhypergeom: Evaluate Density of Noncentral Hypergeometric Distribution
Description
This function evaluates the density of the the Noncentral
Hypergeometric distribution at a single point or all points.
Usage
dnoncenhypergeom(x=NA, n1, n2, m1, psi)
Arguments
x
The location to evaluate the density. If x is NA,
then a matrix is returned with the density evaluated at all possible
points.
n1
The size of group one.
n2
The size of group two.
m1
The observed number of positive outcomes (in both groups).
psi
Odds ratio.
Value
The density evaluated at point x, or a matrix with
the first column containing the possible values of the random
variable, and the second column containing the probabilities.
source
L. G. Liao and Ori Rosen. 2001. ``Fast and Stable Algorithms for Computing
and Sampling From the Noncentral Hypergeometric Distribution." The
American Statistician. 55: 366-369.
Details
The Noncentral Hypergeometric is particularly useful for conditional
inference for $(2 \times 2)$ tables. We use the
parameterization and algorithms of Liao and Rosen (2001). The
underlying R code is based on their published code. See their
article for details of the parameterization.