Martin--
Many have complained about the lack of inbuilt distributions in Stata,
but it is nevertheless useful to understand how to create random
numbers of any given distribution. In this case, Jon already had the
answer in hand, but the general principle is what he was looking for,
I think. Using a inbuilt function, or calling R, would not illuminate
the general principle, IMHO.
On Feb 20, 2008 7:48 AM, Martin Weiss <[email protected]> wrote:
> Well, at the end of the day, it is easy enough to call R with the
> -shell-/-winexec- commands, generate with the rexp() command there and to
> export with the foreign-package back to Stata. For this reason, I have never
> bothered to look at Stata`s own commands: at the time, it also seemed
> unclear to me why one would write things like "invnormal(uniform())" only to
> generate normal random numbers. Seems horribly complicated...
>
> Martin Weiss
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Jon Schwabish
> Sent: Wednesday, February 20, 2008 3:03 AM
> To: [email protected]
> Subject: st: exponential distribution
>
> Does anyone know how to create an exponential
> distribution with a mean of 1 to use as random
> numbers? I believe it's a tweak on exp=-ln(uniform()),
> but am not sure.
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/