Bookmark and Share

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, is already up and running.

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

st: RE: RE: RE: RE: RE: Stata stuck in loop with -rndpoi-?

From   "Karen Wright" <>
To   <>
Subject   st: RE: RE: RE: RE: RE: Stata stuck in loop with -rndpoi-?
Date   Thu, 13 May 2010 16:27:10 +0100

Thank you very much for the help.

>>> "Martin Weiss" <> 13/05/2010 16:06 >>>

" You need something with a better algorithm."

-genpoisson-, as in -findit genpoisson, does not complain or behave weirdly:

set obs 10000
genpoisson x, mu(710)
hist x


-----Original Message-----
[] On Behalf Of Nick Cox
Sent: Donnerstag, 13. Mai 2010 16:57
Subject: st: RE: RE: RE: RE: Stata stuck in loop with -rndpoi-?

It's an underflow problem. -rndpoi- at one point calculates exp(-mean),
but try 

. di exp(-710)

and you will get 0. Even if you get results for means near 700, they
will be of dubious accuracy. You need something with a better algorithm.
Alternatively, won't a Poisson with mean 700 look pretty near Gaussian
any way? I get the skewness and kurtosis to be 

. di 1/sqrt(700)

. di 3 + 1/700

which would cause broad and continuing smiles of pleasure in many
branches of statistical science. 


Nick Cox

What I said in 2003 still holds. 


Martin Weiss

Also note Nick`s advice at, though
may have changed materially in the meantime...

Karen Wright

Unfortunately my IT department has a problem with letting us upgrade
they have to perform it and do not want to - which is why I was trying
to do
it without the ugrade.  Thank you, I shall just have to pester them

>>> "Martin Weiss" <> 13/05/2010 14:59:48 >>>

You could just upgrade for free to Stata 10.1, and use the -rpoisson()-

Karen Wright

I am attempting to generate 10000 random number based on a poisson
distribution with mean from my data, using -rndpoi- (from ssc).
I seem to encounter a problem when the mean is greater than 700.  Would
anyone be able to help me, either with an alternative method of
the figures I need, or what I am currently doing wrong?


*this works:
rndpoi 10000 694.5
*this doesn't:
rndpoi 10000 710
I am currently using Stata 10.0 on Windows. 

*   For searches and help try:

*   For searches and help try:

The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company Limited by Guarantee, Registered in England under Company No. 534147 with its Registered Office at 123 Old Brompton Road, London SW7 3RP.

This e-mail message is confidential and for use by the addressee only.  If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer and network.

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index