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]

Re: st: Questions for random data generation and value label


From   Yu Xue <snowrain@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Questions for random data generation and value label
Date   Wed, 13 Mar 2013 18:50:55 -0500

This is what I got after running 'jnsn':
**************************************************************************************************
jnsn seq_num

Mean and moments for seq_num

Mean=3.049
Variance=1.668
Skewness=0.613
Kurtosis=2.995

Johnson distribution type: SB

gamma=1.253
delta=1.388
xi=0.234
lambda=9.151

Note: program terminated successfully

ajv , distribution(`r(seq_num1)') generate(fake_mpg)
lambda(`r(lambda)')xi(`r(xi)') gamma(`r(gamma)') delta(`r(delta)')

sum seq_num

Variable |    Obs          Mean           Std.Dev.                Min
                Max
-------------------------------------------------------------------------------------------------
seq_num    87469      3.049019    1.291566            1.000013         9.490211

sum seq_num1
Variable |    Obs          Mean           Std.Dev.                Min
                Max
-------------------------------------------------------------------------------------------------
seq_num1  87469     3.045258     1.290069            .3887532        8.484454

*******************************************************************************************************
Min in "seq_num" and "seq_num1" are very different, which is what I
called "not accurate" before.

To Maarten:

I may be confused with some statistical theories and terms in order
for you to answer my question, if so, sorry about that. I found some
useful information before on this website:
http://galton.uchicago.edu/~collins/resources/stata/stata-commands.html,
which shows how to generate random data with some specific parameters
without mentioning the type of distribution. But I know that it is
simpler than the random data that I want to create, please see below
about what I learned from that website:

Generate n uniform random variables (equal chance of all outcomes
between a and b):
gen vname=a + (b - a)*uniform()
Generate normal data with mean mu and standard deviation sigma:
gen vname= mu + sigma * invnorm(uniform())

What I want to generate is similar like that but with all specific a,
b, mu, and sigma considered no mater what kind of distribution is. If
I have to specify the type of distribution in order for you to answer
my question, I will specify a normal distribution.

Thank you all very much for your answers!
Mark
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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