Bookmark and Share

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: lag length selection in unbalanced panel


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: lag length selection in unbalanced panel
Date   Wed, 28 Sep 2011 09:28:46 +0100

As you explain, you changed the code to use -xtfisher- (SSC) not
-levinlin- (SSC). On a glance at the helps it is not clear to me that
the -lags()- option of each is exactly equivalent.

A big question is that we can't see what is in the macro -opt_lag-, so
you need to see what is inside that macro and work out whether it
matches the requirements of -xtfisher-.

I am bailing out at this point as the best advice to you now seems to
require econometric understanding of this quesion.

Nick

2011/9/28 spyridoula dimou <[email protected]>:
> Hello! Thanks for the quick response!
>
> My panel is unbalanced. It consists of 30 countries with data from 1990 to 2007 (541 observations). I want to employ the -xtfisher- command as this seems to be appropriate in my case. I need to check for stationarity in order to decide whether a cointegration test could be done. My panel apart from the country (country) and time (years) variables consists of other 3 variables, total health spending (y), number of nurses (n) and number of doctors (d). According to the proposed
> routine by http://www.stata.com/statalist/archive/2005-02/msg00264.html I wrote the following (for my first variable y):
>
> levels country, local(levels)
> foreach l of local levels {
>        varsoc y if country == `l'
>        matrix A = r(stats)
>        if `l' > 1 {
>                matrix C = C \ A
>        }
>        else {
>                matrix C = A
>        }
> }
> svmat C, name(col)
> keep if HQ < .
>
> egen id = fill(1 1 1 1 1 2 2 2 2 2)
>
> egen minh = min(H), by(id)
> gen optimal_lag = lag if minh == HQ
>
> sort id opt
> forv i = 1(5)115 {
>        local lag = opt[`i']
>        local opt_lag "`opt_lag' `" "' `lag'"
> }
>
> restore
> }
> xtfisher y, lag(`opt_lag')
>
> and stata displays
> option lag() incorrectly specified
>
> I hope this helps you!
> Thanks again!!!
>
>  --- Στις Τρίτ., 27/09/11, ο/η Nick Cox <[email protected]> έγραψε:
>
>> Από: Nick Cox <[email protected]>
>> Θέμα: Re: st: lag length selection in unbalanced panel
>> Προς: [email protected]
>> Ημερομηνία: Τρίτη, 27 Σεπτέμβριος 2011, 22:38
>> Impossible to say on this evidence.
>> We need to see all your code. We
>> may need to know more about your data.
>>
>> Nick
>>
>> 2011/9/27 spyridoula dimou <[email protected]>:
>>
>> > I am using an unbalanced panel, for which I want to
>> perform the Fisher stationarity test. Therefore, I have to
>> choose the appropriate number of lags to include. As the
>> varsoc command does not work in panel data, I have tried to
>> derive the optimal number of lags using the HQIC as proposed
>> by http://www.stata.com/statalist/archive/2005-02/msg00264.html.
>> > When coming to perform my test, I copy the procedure
>> proposed, changing the variable names and write
>> > xtfisher y, lag(`opt_lag').
>> > Then stata displays:
>> > option lag() incorrectly specified
>> > What is the mistake I make? When running the procedure
>> using the
>> > http://fmwww.bc.edu/ec-p/data/hayashi/sheston91.dta
>> > everything works fine...
>>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index