--- Nelly EXBRAYAT <[email protected]> wrote:
> I want to create a country-specific time trend variable with panel
> data.
That pretty much depends on your data, but here are some examples:
Assuming the observations are equally spaced over time you can generate
it by:
bys country: gen t = _n
If you know that each country was first observed in say 1960 and
observations are years appart, then you can type:
bys country: gen t = _n + 1959
If you have a variable called first that specifies when you first
observed the country you can type:
bys country: gen t = _n + first - 1
use -help by- and -help _n- for more information, furthermore just type
the commands and use -list country t in 1/10- to see the first 10 cases
in you dataset to see what it is doing.
Hope this helps,
Maarten
-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands
visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434
+31 20 5986715
http://home.fsw.vu.nl/m.buis/
-----------------------------------------
___________________________________________________________
Now you can scan emails quickly with a reading pane. Get the new Yahoo! Mail. http://uk.docs.yahoo.com/nowyoucan.html
*
* 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/