Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: AW: RE: generate lognormal RV less than 20000 observations.


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: AW: RE: generate lognormal RV less than 20000 observations.
Date   Fri, 9 Apr 2010 11:29:14 +0200

<> 


" A one-line call with reference to -exp(rnormal())- gets you random draws
from a lognormal quite directly."


This is what the example cited in my earlier post from -h simulate- boils
down to, although it may be wrapped in too much other stuff for beginners to
appreciate this point. [U], page 148, and various other instances in Stata
11 manuals, show Nick`s direct method as well...



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Nick Cox
Gesendet: Freitag, 9. April 2010 11:20
An: statalist@hsphsun2.harvard.edu
Betreff: st: RE: generate lognormal RV less than 20000 observations.

This sparked a thread with Martin Weiss. I have four comments by way of
summarizing and going beyond that exchange. 

1. Please do specify where user-written software you refer to comes from. 
(Most postings from Sun Samn ignore advice in the FAQ in at least one way.) 

2. It is quite untrue that -rndlgn- requires 20,000 observations.

3. In this case, the user-specified software is not, and never has been,
needed. A one-line call with reference to -exp(rnormal())- gets you random
draws from a lognormal quite directly. (Before -rnormal()- was introduced,
other functions could be used, and indeed were used internally within
-rndlgn-. I imagine that for their own reasons Joe Hilbe and friend wanted
something uniform in syntax with the other commands that they wrote a while
back.)  

4. -rndlgn- is a command, not a function. -exp()- and -rnormal()- are
functions. 

Nick 
n.j.cox@durham.ac.uk 

sun samn

   I know the function ' rndlgn' can generate lognormal RVs, but it requires
the numbers of observation to be at 20000. Now, I want a list of only 500.
What should I do then?

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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   |   Site index