[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: exponential distribution

From   "Austin Nichols" <>
Subject   Re: st: RE: exponential distribution
Date   Wed, 20 Feb 2008 08:24:21 -0500

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 <> 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:
> [] On Behalf Of Jon Schwabish
> Sent: Wednesday, February 20, 2008 3:03 AM
> To:
> 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:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index