Statalist


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

Re: st: RE: exponential distribution


From   "Austin Nichols" <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: exponential distribution
Date   Wed, 20 Feb 2008 08:24:21 -0500

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 <martin.weiss@uni-tuebingen.de> 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: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Jon Schwabish
> Sent: Wednesday, February 20, 2008 3:03 AM
> To: statalist@hsphsun2.harvard.edu
> 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/



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