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
Giovanni Palmieri <[email protected]>
To
"[email protected]" <[email protected]>
Subject
RE: st: Repeated time values within panel
Date
Sun, 26 Jan 2014 14:01:04 +0100
Nick,
Thanks for the reply, I have thought to follow these ways in order to solve and would like your opinion.
The first way I can think about my dataset is like trying to set a year country panel, while having monthly observations. For each observation I get a unique number within the group, like 1, 2,3 then I create a new var and
xtset newvar country
so, now my new time variable newvar contains unique year-one observations and setting the data will be fine but I do not know how to do this. On the other hand could that create problems taking some values to zero when I will take the first difference ?
However my preoccupation on this is that I am dealing with 2 values of macro variables(GDP,cpi etc) per year - Choosing one or taking ake the average is not theoretically correct . If I take lags, will they not be meaningful?
I tried with - collapse- and worked but still I am missing the impact of the single value of the indicator on each variable.
The second way I can think is to reshape my data but again I do not know how to do it and what could be the possible result.
Thanks for your time
Giovanni
----------------------------------------
> Date: Sun, 26 Jan 2014 11:24:04 +0000
> Subject: Re: st: Repeated time values within panel
> From: [email protected]
> To: [email protected]
>
> -xtset- won't allow repeated times within panels when you declare both
> identifier and time variable. This is an absolute rule and exceptions
> aren't allowed. Stata can't be faked or fooled on this. I can't advise
> on what is "correct" for your analysis, however. -xtset- allows just
> an identifier, but I can't see that is going to help you at all here.
> Nick
> [email protected]
>
>
> On 25 January 2014 17:58, Giovanni Palmieri
> <[email protected]> wrote:
>> 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/
>
> *
> * 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/
*
* 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/