Statalist The Stata Listserver

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

st: simulating a lognormal distribution

From   Jeph Herrin <[email protected]>
To   [email protected]
Subject   st: simulating a lognormal distribution
Date   Tue, 12 Sep 2006 09:23:52 -0400

This is not, strictly speaking, a Stata problem, but I am hoping
to find a Stata solution.

I am trying to simulate a lognormal distribution, but have only
the median (which I'm willing to assume is the log mean) plus
the mean and sd of the non-log transformed data. Put another way,
I have median, mean and sd of Y, but log(Y) is normal, and I would
like to simulate Y.

I have found -rndlgn-, which will simulate a random log normal
distribution, but only if I have the mean and sd of log(Y). The
only idea I have is to generate a series of log normal distributions
X with mean = log(median(Y)) and a range of sds, until I end up with
one where exp(X) has the mean and sd of Y. But this seems overly
computing intensive for my purposes, as I will need to do this for
a large number of obs with a loop that runs many times.

Any other ideas? In particuar, am I missing an obvious way to get
the mean & sd of log(Y) from the mean and sd of Y?


*   For searches and help try:

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