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

st: using egen & fill coupled to another variable?


From   peter <[email protected]>
To   [email protected]
Subject   st: using egen & fill coupled to another variable?
Date   Sun, 26 Jan 2003 13:11:09 -0800

On Sunday 26 January 2003 11:50 am, Ronnie Babigumira wrote:
> Not sure I understand you, what exactly will be the diffrence between x1
> and x2 (list a few arbitrary entries)

Sorry for the vagueness :-) I'll try again:

Yn  is a variable containing a pattern. Xn is egen generated data which must
contain the pattern but with slightly different proportions. Hence if Y1 
contains 70 1's and 30 2's, then X1 might contain 68 1's and 32 2's. The 
amount difference between X1 and Y1 would vary slightly each time X1 is 
generated, and be randomly distributed:

Eg.
 Y1	X1
1       1
1	2
1	1
1	2
1	1
1	2
1	1
2	2
2	1
2	1

So for over 100 Y variables I need some way to have egen look at the 
proportions of 1's and 2's in each one of those variables using 'fill' or 
whatever, generate similar data for X, where Xn varies slightly in the 
proportions of 1's and 2's in each Yn.

I hope that makes sense? Probably some simple thing in Stata, (am using 
version 7), but I cannot find it.

Thanks very much for any help you can render.
--Peter

 

*
*   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