Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Determining optional lag length using "varsoc" for panel data

    I have 100 countries and its time series data from 1990 to 2000.
    Want to determine the optimal lag length for the explanatory variables, i know varsoc does it for times series.
    But it gives me an error

    repeated time values in sample

    i think it's because it's panel, the time variable has repeated values.

    How can i solve this issue?

    Thanks.

  • #2
    Questions regarding panel cointegration and unit roots testing (unlike time series) are generally very poorly addressed in this forum. I would guess that the reason is that this topic is fairly new and is not part of any standard curriculum in economics (econometrics). As you point out, -varsoc- is a time series command, and it fails if applied to panel data. Because observations of each cross-sectional unit in a panel can be considered as individual time series, through some technique you can use -varsoc- to obtain the lag-order statistics for a panel unit root test: See this old post by Scott Merryman.

    http://www.stata.com/statalist/archi.../msg00264.html

    However, Stata has an option that allows you to automatically select the optimal lag length for the Levin-Lin-Chu panel unit-root test based on any one of these three criteria given that you specify a maximum lag length (the default being 4): Akaike information criterion (aic), Bayesian information criterion (bic) or Hannan-Quinn information criterion (hqic). This function is not currently available for the other panel unit root tests (Harris-Tzavalis, Breitung, Fisher etc.)

    From personal experience, I find that a number of macroeconometricians prefer to use the statistical software Eviews when working with this kind of data. This software allows automatic selection of the lag length and bandwidth for tests involving kernel weighting. They have a help page which you may find useful.

    http://www.eviews.com/help/helpintro...t_Testing.html

    Here, they use the Grunfeld dataset to perform a panel unit root test on real gross investment (variable "invest") where automatic lag length selection is based on Schwarz information criterion (SIC). The Levin-Lin-Chu statistic (p-value) is 2.39544 (0.9917) which is very close to 2.5401 (0.9945) obtained from Stata with default maximum lag length (=4) and automatic lag selection based on BIC.

    Code:
    . webuse grunfeld
    
    . xtunitroot llc invest,lags(bic 4)
    
    Levin-Lin-Chu unit-root test for invest
    ---------------------------------------
    Ho: Panels contain unit roots               Number of panels  =     10
    Ha: Panels are stationary                   Number of periods =     20
    
    AR parameter: Common                        Asymptotics: N/T -> 0
    Panel means:  Included
    Time trend:   Not included
    
    ADF regressions: 0.60 lags average (chosen by BIC)
    LR variance:     Bartlett kernel, 8.00 lags average (chosen by LLC)
    ------------------------------------------------------------------------------
                        Statistic      p-value
    ------------------------------------------------------------------------------
     Unadjusted t        -0.4638
     Adjusted t*          2.5401        0.9945
    ------------------------------------------------
    If you opt for some other test e.g., Fisher test, you can perform the selection for each cross-section using -varsoc-. From the output in Eviews, the maximum lag length selected is 3 which corresponds to company with id=3 (The remainder are either 0 or 1). The obtained PP-Fisher Chi-square (p-value) with lag-length= 3 is 12.0067 (0.9158) which is very close to that obtained from E-views 12.9243 (0.8806).



    Code:
    . xtunitroot fisher invest,lags(3) pperron
    
    Fisher-type unit-root test for invest
    Based on Phillips-Perron tests
    -------------------------------------
    Ho: All panels contain unit roots           Number of panels  =     10
    Ha: At least one panel is stationary        Number of periods =     20
    
    AR parameter:    Panel-specific             Asymptotics: T -> Infinity
    Panel means:     Included
    Time trend:      Not included
    Newey-West lags: 3 lags
    ------------------------------------------------------------------------------
                                      Statistic      p-value
    ------------------------------------------------------------------------------
     Inverse chi-squared(20)   P        12.0067       0.9158
     Inverse normal            Z         1.8286       0.9663
     Inverse logit t(49)       L*        2.0741       0.9783
     Modified inv. chi-squared Pm       -1.2639       0.8969
    ------------------------------------------------------------------------------
     P statistic requires number of panels to be finite.
     Other statistics are suitable for finite or infinite number of panels.
    ------------------------------------------------------------------------------
    If I was working on this kind of data in Stata, I would suggest to the Stata developers to incorporate this automatic selection feature into -xtunitroot-. There is a wishlist for Stata 15 where you could do this.

    http://www.statalist.org/forums/foru...t-for-stata-15
    Last edited by Andrew Musau; 22 Oct 2016, 17:35.

    Comment


    • #3
      Dear Andrew,
      Thank you very much for a very instructive post regarding -varsoc-.
      Stata's Fisher panel unit root test in doesn't allow to automatically select the optimal lag. Instead of using different lag structure for each country, as the code suggested by Scott Merryman does (I have 47 countries with annual data T=24), I thought of using single lag structure. I run -varsoc- for each country, and my question is what would be a good approach: to choose the maximal lags obtained over all countries, or the common one?
      Thank you,
      Anat

      Comment


      • #4
        Hi Anat, in these cases I find that it is better to be conservative so I would go for the maximum lag. However, you have to look out for cases where there is a large discrepancy, e.g., varsoc suggests 6 lags for one or two countries and all the rest 2. In such cases, picking the maximum may not be the best decision rule.

        Comment

        Working...
        X