Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Data management


From   "Roy,Suryadipta" <[email protected]>
To   [email protected]
Subject   st: Data management
Date   Sat, 24 Mar 2007 16:59:07 -0500

Hi,

I have a panel data of (say) 100 countries for 10 years. I am trying to attach identification numbers for these countries based on another dataset for merging purposes later on. So, I started with

a. egen id= group(code), where "code" is the code numbers of these countries, e.g. ABW, AFG etc.

b. Then I am trying to replace these id-s with
replace id=3 if id==1;
replace id=5 if id==2;
replace id=8 if id==3;

But the 3rd line of the command is replacing the first set of id-s also. I would greatly appreciate if someone can suggest how to take care of this.

Thanks,
Suryadipta.
*
* 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