Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Yu Xue <snowrain@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Questions for random data generation and value label |
Date | Mon, 11 Mar 2013 10:20:50 -0500 |
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). Your answer to my second question is exactly what I want. I appreciate your help!! * * 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/