RANBIN Function


Returns a random variate from a binomial distribution

Category: Random Number

Tip: If you want to change the seed value during execution, you must use the CALL RANBIN routine instead of the RANBIN function.

Syntax

RANBIN ( seed,n,p )

Arguments

seed

  • is an integer. If seed 0, the time of day is used to initialize the seed stream.

  • Range: seed < 2 31 -1

  • See: 'Seed Values' on page 257 for more information about seed values

n

  • is an integer number of independent Bernoulli trials parameter.

  • Range: n > 0

p

  • is a numeric probability of success parameter.

  • Range: 0 < p < 1

Details

The RANBIN function returns a variate that is generated from a binomial distribution with mean np and variance np (1- p ). If n 50, np 5, or n(1-p) 5, an inverse transform method applied to a RANUNI uniform variate is used. If n > 50, np > 5, and n(1-p) > 5, the normal approximation to the binomial distribution is used. In that case, the Box-Muller transformation of RANUNI uniform variates is used.

Comparisons

The CALL RANBIN routine, an alternative to the RANBIN function, gives greater control of the seed and random number streams.

See Also

Call routine:

  • 'CALL RANBIN Routine' on page 366




SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 704

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net