Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: generating correlated data


From   Richard Williams <[email protected]>
To   "[email protected]" <[email protected]>, "[email protected]" <[email protected]>
Subject   Re: st: generating correlated data
Date   Sun, 14 Jun 2009 14:23:51 -0500

At 12:32 PM 6/14/2009, Jeph Herrin wrote:

Try -drawnorm-

Whether you use -corr2data- or -drawnorm- depends on exactly what it is you want to do. With -corr2data-, you get exactly the correlation you specify, e.g. if you want a correlation of .6 the data you create will have a correlation of .6. With -corr2data-, it is like you have an entire population in your created data set. No matter how many times you run the command, no matter what seeds you use, the data set will always have the exact same means, standard deviations and correlations.

With -drawnorm- you are sampling from a population with the given correlation. So, if you specify a correlation of .6, the generated data might have a correlation of .57, or .63, or whatever, i.e. it won't be exactly .6 because of sampling variability. If you create different samples with different seeds you will get results that are at least slightly different each time.

One use for -corr2data- is when you have the published means, correlations and standard deviations for a data set, but not the original data itself. With -corr2data-, you could replicate the published analyses, and do a limited amount of tweaking, e.g. adding or deleting variables from the models. For examples, see pages 8-10 of

http://www.nd.edu/~rwilliam/stats1/OLS-Stata9.pdf


-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  [email protected]
WWW:    http://www.nd.edu/~rwilliam

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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