Announcement

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

  • Lags in Dickey Fuller

    How do i determine the number of lags # when doing the augmented dickey fuller

    dfuller ln_consump, lags(#) trend


  • #2
    You can use the varsoc command to obtain the optimal lag order in a preestimation step:
    Code:
    . webuse lutkepohl2
    (Quarterly SA West German macro data, Bil DM, from Lutkepohl 1993 Table E.1)
    
    . tsset qtr
            time variable:  qtr, 1960q1 to 1982q4
                    delta:  1 quarter
    
    . varsoc ln_consump, exog(qtr)
    
       Selection-order criteria
       Sample:  1961q1 - 1982q4                     Number of obs      =        88
      +---------------------------------------------------------------------------+
      |lag |    LL      LR      df    p      FPE       AIC      HQIC      SBIC    |
      |----+----------------------------------------------------------------------|
      |  0 |  166.351                      .001397  -3.73526  -3.71258  -3.67896  |
      |  1 |  273.716  214.73    1  0.000  .000125  -6.15263  -6.11861  -6.06818  |
      |  2 |  274.002  .57139    1  0.450  .000127   -6.1364  -6.09103  -6.02379  |
      |  3 |   276.19  4.3771    1  0.036  .000123  -6.16341   -6.1067  -6.02265  |
      |  4 |   281.13  9.8805*   1  0.002  .000113* -6.25296* -6.18491* -6.08405* |
      +---------------------------------------------------------------------------+
       Endogenous:  ln_consump
        Exogenous:  qtr  _cons
    
    . dfuller ln_consump, lags(3) trend regress
    
    Augmented Dickey-Fuller test for unit root         Number of obs   =        88
    
                                   ---------- Interpolated Dickey-Fuller ---------
                      Test         1% Critical       5% Critical      10% Critical
                   Statistic           Value             Value             Value
    ------------------------------------------------------------------------------
     Z(t)             -1.162            -4.066            -3.462            -3.157
    ------------------------------------------------------------------------------
    MacKinnon approximate p-value for Z(t) = 0.9180
    
    ------------------------------------------------------------------------------
    D.ln_consump |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
      ln_consump |
             L1. |  -.0408541    .035157    -1.16   0.249    -.1107925    .0290843
             LD. |  -.0872179   .1078276    -0.81   0.421    -.3017213    .1272856
            L2D. |   .2795149   .1069497     2.61   0.011     .0667579    .4922719
            L3D. |   .3379435   .1082643     3.12   0.002     .1225713    .5533157
          _trend |    .000775   .0007044     1.10   0.274    -.0006263    .0021763
           _cons |   .2553876   .2092761     1.22   0.226    -.1609292    .6717045
    ------------------------------------------------------------------------------
    Note that the dfuller lag order needs to be specified for the first-differenced model, hence it is the optimal lag order obtained with varsoc less one.
    https://twitter.com/Kripfganz

    Comment


    • #3
      Hi Sebastian,
      Could you elaborate on your final point? - that the optimal lag length is less one. I don't understand why this is the case and can't see mention of this in the stata manual.
      Thanks,

      Comment


      • #4
        The Stata help file states:
        lags(#) specifies the number of lagged difference terms to include in the covariate list.
        If the model in levels (specified based on the varsoc command) contains 2 lags, i.e. \(y_{t-1}\) and \(y_{t-2}\), then the model in first differences can only contain one lag, i.e. \(\Delta y_{t-1} = y_{t-1} - y_{t-2}\), because the second lagged difference \(\Delta y_{t-2} = y_{t-2} - y_{t-3}\) would be a function of the third lagged level \(y_{t-3}\) which is not part of the level model:
        \[y_{t-1} = \beta_1 y_{t-1} + \beta_2 y_{t-2} + e_t\\
        \Delta y_{t-1} = (\beta_1 + \beta_2 - 1) y_{t-1} - \beta_2 \Delta y_{t-1} + e_t\]
        https://twitter.com/Kripfganz

        Comment


        • #5
          Thank you, I now understand.

          Comment


          • #6
            Dear all,

            If I specify lag(0) directly, is my stationarity test considered wrong? Thanks in advance for your reply.

            Best,
            Emna

            Comment


            • #7
              If you specify lag(0) although higher-order lags have predictive power, your residuals will be serially correlated which turns the Dickey-Fuller test invalid.
              https://twitter.com/Kripfganz

              Comment

              Working...
              X