Statalist The Stata Listserver


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

Re: st: how to create a country-specific time trend


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: how to create a country-specific time trend
Date   Tue, 16 Jan 2007 17:17:15 +0000 (GMT)

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



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