Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Repeated time values within panel
From
Giovanni Palmieri <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: Repeated time values within panel
Date
Sat, 25 Jan 2014 18:58:06 +0100
Dear all,
I am having a problem setting xt set in stata.I have a macro panel for 40 counties with 23 variables that include the usual annual macro variable (cpi ,debt , gdp etc), dummies and some other indicators that in some cases change their value in the same year more than once .
I do not know the exact date their value changes as those are indicators created by researchers. Anyway what I did is that for each indicator that takes more than one value in the same year I copied -pasted for each value the all the observation of the other variables. I provide some of data as an example just to make it more clear only for some of the variables
country year countrycode GDPconstant GDPpcurrent cpi indicator1 indicator2 indicator3 Dummy1
Australia 1990 1 4.30E+11 3.10E+11 69.2101 -4.5 -4.5 1 0
Australia 1990 1 4.30E+11 3.10E+11 69.2101 -14.9 -14.9 1 0
Australia 1991 1 4.20E+11 3.30E+11 71.4406 -14.9 -14.9 1 0
Australia 1991 1 4.20E+11 3.30E+11 71.4406 -14.9 -14.9 1 0
Australia 1992 1 4.30E+11 3.30E+11 72.1449 -14.9 -14.9 1 0
Australia 1993 1 4.40E+11 3.10E+11 73.453 -14.9 -14.9 1 0
Australia 1993 1 4.40E+11 3.10E+11 73.453 -0.164745 -0.164745 1 0
Australia 1994 1 4.60E+11 3.20E+11 74.8449 -0.164745 -0.164745 1 0
Australia 1995 1 4.80E+11 3.70E+11 78.3163 -0.164745 -0.164745 1 0
Australia 1996 1 5.00E+11 4.00E+11 80.3622 -0.164745 -0.164745 1 0
Australia 1996 1 5.00E+11 4.00E+11 80.3622 22.5933 22.5933 3 1
Australia 1997 1 5.20E+11 4.40E+11 80.5635 22.5933 22.5933 3 1
Australia 1998 1 5.40E+11 4.00E+11 81.251 22.5933 22.5933 3 1
Australia 1998 1 5.40E+11 4.00E+11 81.251 48.4581 48.4581 2 1
Australia 1999 1 5.70E+11 3.90E+11 82.4417 48.4581 48.4581 2 1
Australia 2000 1 5.90E+11 4.20E+11 86.1311 48.4581 48.4581 2 1
Australia 2001 1 6.00E+11 3.80E+11 89.9044 48.4581 48.4581 2 1
Australia 2001 1 6.00E+11 3.80E+11 89.9044 33.033 30.7286 2 1
I am able to xt set and run regressions only when I am not setting the time variable which I really need in order to conduct afterwards unit root tests. When I try to include the time var I get an error
xtset countrycode year
repeated time values within panel
Two important question
1).Have I set up the data correctly?
2) How can I xt set including time variable without deleting duplicates?
Macro values come from IMF-IFS and are yearly based. So because in my model macro variables are influenced by the indicators I am allowing separately index values as different observations in the same year . My first thought has been to take average or choose one of the observation for each year however this is not correct because simply destroys my theoretical assumption of the influence of the indicators to the macro variables and that is what I want to capture.
Thank you
Giovanni Palmieri
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/