Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[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" <[email protected]>
To   <[email protected]>
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: [email protected]
[mailto:[email protected]] Im Auftrag von Nick Cox
Gesendet: Freitag, 9. April 2010 11:20
An: [email protected]
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 
[email protected] 

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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index