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

Re: st: RE: generating data sets with specific parameters

From   Richard Williams <[email protected]>
To   [email protected]
Subject   Re: st: RE: generating data sets with specific parameters
Date   Thu, 19 Aug 2004 10:14:08 -0500

At 06:56 PM 8/18/2004 -0500, Scott Merryman wrote:
You might try -corr2data-
-corr2data- is good if you want the parameters to come out EXACTLY as specified, e.g. if you say the mean is 10 and the SD is 2 then that is what they will indeed be in the data set that is created. It is like creating a population with the specified parameters. -drawnorm-, on the other, draws a random sample from a population with the specified parameters; hence, because of sampling variability, the numbers in the sample will differ a bit from the numbers you specify.

-corr2data- is especially good if, say, you have a published correlation matrix and want to replicate the results. In SPSS, you would typically just input the means, correlations and SDs; in Stata you create a fake data set. -drawnorm- is probably better if you are doing some sort of simulation.

Note that -corr2data- always produces the exact same data set unless you use the -seed- parameter of -corr2data- (not the separate -seed- command.)

Key caution: If your goal is to use -corr2data- to analyze a published correlation matrix, remember, these are simulated data, not the original. There is only so much you can do, e.g. you can't go computing interaction terms, take logs, analyze a subsample, or anything like that. You can do stuff like run OLS regressions using different subsets of the variables. The ONLINE help for -corr2data- goes over this a bit.

I discuss the use of -corr2data- on pages 7-9 of

Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
FAX: (574)288-4373
HOME: (574)289-5227
EMAIL: [email protected]
WWW (personal):
WWW (department):

* For searches and help try:

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