Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: generating dataset with specific params


From   Christopher F Baum <[email protected]>
To   [email protected]
Subject   st: Re: generating dataset with specific params
Date   Wed, 18 Aug 2004 20:00:58 -0400

wrote

After reviewing the faq's and the archive I've been unable to find guidance
or a module that would assist in generating data sets from scratch or at
least near it. For instance, is it possible to identify statistical
parameters, input them into stata, which would produce a data set as its
product, such as, generate a newvariable with 109 observations that have a
mean of 10.62 and a standev of 1.74. Maybe I've missed some guidance or
perhaps such a command is not possible (or desirable?), or this is a goofy
thought to start with. I reviewed -generate-, -exp-, -if-, etc but
everything appears to build on a primary data set. When reading articles or
text examples, one doesn't have access to the data set often, and sometimes
I'd like to test what's being put forward on a dataset, just simply run the
numbers. I have used -display- and some of the -i- commands, that's fine,
but one can't work from other angles what's being put forward in the
article/text, etc.


. set obs 109
obs was 0, now 109

. g double v1 = 1.74*invnorm(uniform())+10.62

. su

Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
v1 | 109 10.6402 1.734998 6.296962 14.36916



This would work better with a larger sample:

. set obs 10900
obs was 0, now 10900

. g double v1 = 1.74*invnorm(uniform())+10.62

. su

Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
v1 | 10900 10.61984 1.736441 3.801061 17.71306

Kit

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index