Learn R Programming

MCMCpack (version 0.4-5)

rnoncenhypergeom: Generate Random Draw from Noncentral Hypergeometric Distribution

Description

This function generates random draws from the Noncentral Hypergeometric distribution.

Usage

rnoncenhypergeom(n, n1, n2, m1, psi)

Arguments

n
The number of draws to make from the distribution.
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

  • An list of n random draws from the distribution.

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.

See Also

dnoncenhypergeom

Examples

Run this code
rnoncenhypergeom(1, 500, 500, 500, 6.0)

Run the code above in your browser using DataLab