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.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Dirk Enzmann <dirk.enzmann@uni-hamburg.de> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Re: Random draws from a negative binomial distribution |

Date |
Thu, 20 Jun 2013 11:46:48 +0200 |

StataCorp and the Stata community are really amazing! Dirk

Dirk Enzmann has tickled a domain limit of Stata's -rnbinomial()- function. He states:> Unfortunately, I am not able to solve the following problem in Stata > which I can solve easily using R: > > As far as I can see Stata does not allow to draw random values from a > negative binomial distribution if "size" (= 1/alpha) is less than 0.1 > (see -h rnbinomial-). I tried to circumvent this problem by (1) creating > random draws from a gamma distribution with shape parameter = size and > scale parameter = (1-prob)/prob, with prob = size/(size+mu), and > subsequently creating random draws from a poisson distribution with > parameter m = the result of the previous random draws from the gamma > distribution. However, if size is small, this does not help either.We have determined that the domain limit for the size parameter, labeled as n in Stata's documentation, is too conservative for a certain region of the parameter space, when n<0.1 but n*(1-p)/p<100 and p^n>1e-4. Dirk's example falls into this region. We will update -rnbinomial()- in Stata 12 and Stata 13 to produce a result in this region. - -- Rich rgates@stata.com

-- ======================================== Dr. Dirk Enzmann Institute of Criminal Sciences Dept. of Criminology Rothenbaumchaussee 33 D-20148 Hamburg Germany phone: +49-(0)40-42838.7498 (office) +49-(0)40-42838.4591 (Mrs Billon) fax: +49-(0)40-42838.2344 email: dirk.enzmann@uni-hamburg.de http://www2.jura.uni-hamburg.de/instkrim/kriminologie/Mitarbeiter/Enzmann/Enzmann.html ======================================== * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/

- Prev by Date:
**st: Re: Re: Re: FW: Mediation with endogenous mediator and endogenous independent variables** - Next by Date:
**st: Missing observations** - Previous by thread:
**Re: st: Re: Random draws from a negative binomial distribution** - Next by thread:
**st: Variable name length limit** - Index(es):