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 on April 23, and its replacement, 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 <>
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


Johnson distribution type: SB


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
seq_num    87469      3.049019    1.291566            1.000013         9.490211

sum seq_num1
Variable |    Obs          Mean           Std.Dev.                Min
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:,
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!
*   For searches and help try:

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