Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: Generation of Random Lognomral Distributions


From   Jose Marin <marinjos@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: Generation of Random Lognomral Distributions
Date   Sat, 30 Apr 2005 12:32:27 -0400

Thanks Nick, 
Now what i meant about mean and sd whithin a range is that I need the
distributions to be generated randomly. That is, that the mean and
standard deviations be randomly chosen from a range. The end result is
a set of random numbered distribution with randomly chosen mean and
standard deviation.

Does this make any sense??

Thanks again.



On 4/30/05, Nick Cox <n.j.cox@durham.ac.uk> wrote:
> A random sample from a lognormal can be generated directly by
> 
> . gen lognormal = exp(<mean> + <sd> * invnorm(uniform()))
> 
> Here replace <mean> and <sd> by variables or constants giving
> the desired mean(s) and sd(s) of the logged variable.
> 
> I am not clear exactly what you mean by "within a ra[n]ge",
> but some variation on this will get what you want.
> 
> (Naturally, this is the recipe used by -rndlogn-. In
> the help file for that program, and in the code,
> whenever it says variance, it means sd.)
> 
> Nick
> n.j.cox@durham.ac.uk
> 
> Jose Marin
> 
> > I have a quick question.
> > I am trying to generate a large number of random lognormal
> > distributions with mean and standard deviation within a rage. I tried
> > using mkbilogn and rndlgn but they generate distributions around the
> > same inputted mean and standard deviation. I am a new Stata user.
> 
> *
> *   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/
>

*
*   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