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, 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   njcoxstata@gmail.com
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Questions for random data generation and value label
Date   Mon, 11 Mar 2013 15:36:13 +0000

It seems that you want a distribution defined by its mean, standard deviation and range, which may mean the range = max - min or the pair (min, max). I don't know of any distribution defined in this way. Some beta distribution may be closest to what you want. I think you are going to have to specify distribution shape directly or indirectly.

Nick
njcoxstata@gmail.com

On 11 Mar 2013, at 15:20, Yu Xue <snowrain@gmail.com> wrote:

> Thanks Maarten!
> 
> I already checked "-help random_number_functions-", but I still can
> not find the answer to my question.
> 
> I knew that I can use a formula similar like this:
> Var=a+int((b-a+1)*runiform()), to keep a specific range in [a,b]
> and use another formula: Var=invnorm(uniform())*SD+mean, to keep
> specific Standard deviation and mean.
> But I do not know how to generate a "Var" with all specific range, SD, and mean.
> Please note that I do not generate a sample data from the actual data,
> what I want to generate is synthetic data (totally fake data).
> 

*
*   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