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

Re: st: Simulate and corr2data


From   Richard Williams <[email protected]>
To   [email protected]
Subject   Re: st: Simulate and corr2data
Date   Tue, 20 Jan 2004 17:12:57 -0500

There is a seed option in corr2data, e.g.

corr2data x y, n(2000) corr(C) seed(123)

It isn't in the manual, so I assume it is a relatively recent addition; it shows up in help. If you change the seed, you get a different data set.

Keep in mind that even though you can get different data sets, the means, correlations and standard deviations will always be exactly as specified in corr2data, i.e. there won't be any sampling variability that will cause sample values to differ somewhat from the values you have specified. I'm not sure what you are trying to do, but if your goal was to draw a random sample from a population with given parameters, corr2data doesn't do that, i.e. it may be too good for what you have in mind.

At 09:48 PM 1/20/2004 +0000, Allan Reese wrote:

Followed example for simulate except to use corr2data rather than gen to
create the dataset.  Imagine my chagrin when each repetition gave the same
answer!  So tried corr2data from the command prompt and found it gives the
same sample time after time, regardless of any setting of seed.  Does
anyone have a fix please?  Is this an unintended bug?  Looks counter
intuitive and ought to happen only if "set seed" used to restart the
sequence.

If corr2data can not produce independent samples, can I have comments
please on whather it is equivalent to use bootstrap with a large N and
relatively small sample size.  I am interested in sample statistics that
depend on the overall distribution of points, and the default use of
bootstrap to select multiple samples of size N from N points must rely
upon random points being used once, twice or more - or have I completely
misunderstood?
*
*   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