Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.

# Re: st: unexpected -rbinomial- behaviour

 From Jeph Herrin To statalist@hsphsun2.harvard.edu Subject Re: st: unexpected -rbinomial- behaviour Date Tue, 14 Sep 2010 17:26:56 -0400

But it would have been easy enough to trap the endpoints and
return a meaningful (rather than missing) value.

On 9/14/2010 4:34 PM, Tirthankar Chakravarty wrote:

Jeph,

The Stata function -rbinomial- is not defined for p=0. From
h rbinomial
rbinomial(n, p)
Domain n:     1 to 1e+11
Domain p:     1e-8 to 1-1e-8
Range:        0 to n

distribution is correct - the domain of the Binomial distribution is p
\in [0,1]. My guess would be that the p=/=0 condition is a limitation
of the simulation algorithm.

T

On Tue, Sep 14, 2010 at 12:54 PM, Jeph Herrin<stata@spandrel.net>  wrote:


Am I wrong to expect rbinomial(n,0) = 0?

. di rbinomial(10,0)
.

I would think that if P(success)= 0, then E(successes)=0.

Jeph

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/





*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/