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]
Re: st: Repeated time values within panel
From
Christopher Baum <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: Repeated time values within panel
Date
Sun, 26 Jan 2014 12:45:43 +0000
<>
On Jan 26, 2014, at 2:33 AM, Giovanni wrote:
> 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?
1) No.
2) With the data you have constructed, you can't.
As you say at the start, some of the variables you are interested in have changed more than once during the year. There is no way to express that with annual data. You either need higher-frequency data (which would probably not be all that useful if you cannot attach dates to the events) or you can just add interacted indicators that take on 1 if there were _any_ changes in the variable that year. They will not be able to capture multiple events.
When working with IFS (International Financial Statistics) data, it is a very good idea to divide measures that take on values of 10^9, 10^12, etc. and scale them into a more sensible range (e.g., US gdp in trillions or billions, not dollars). That may not matter much in linear regressions, but if you ever use nonlinear estimation techniques, these huge magnitudes may bite you.
Kit
Kit Baum
Professor of Economics and Social Work, Boston College, Chestnut Hill MA, USA
DIW Research Professor, Department of Macroeconomics, DIW Berlin, Berlin, Germany
[email protected] | http://ideas.repec.org/e/pba1.html
*
* 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/