Gregory Caldwell 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.
-------------------------------------------------------------------------------
For the particular example,
set obs 109
set seed 20040819
generate float newvariable = 10.62 + 1.74 * invnorm(uniform())
More generally, I recommend _Statistics with Stata_ by Lawrence C. Hamilton or
_A Handbook of Statistical Analysis using Stata_ by Sophia Rabe-Hesketh and
Brian Everitt. They both will show how to do various familiar (and not-so-
familiar) statistical methods in Stata. They are very practical introductions,
and I believe new editions this year are updated to the current release of
Stata. They're both available from StataCorp.
Joseph Coveney
*
* 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/