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

st: Replacing the content of a counter variable


From   "Aamer Abu-Qarn" <[email protected]>
To   "Statalist" <[email protected]>
Subject   st: Replacing the content of a counter variable
Date   Tue, 27 Dec 2005 15:37:33 +0200

Dear All,
I have a panel (51 obs. Per country) database of 168 countries in which a
country has a code number running from 1 to 168 (the variable contnum). I
dropped some of the countries that have insufficient observations and now
the varable contnum has valuse like 1, 5, 11, 12, 57 and so on. I know that
the number of the remaining countries is _N/51. How do I assign new
consecutive code numbers for the remaining countries so the variable contnum
looks like 1,2,3,....._N/51??? The problem is that I want to run country
specific regressions for all the remaining countries and report _b _se R2
for each regression. I want a loop from 1 to _N/51 but forval doesn't accept
nonvalues. I created a scalar w=_N/51 but forval didn't accept forval x=1/w.

I appreciate your help in these two issues.  

Aamer

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