Announcement

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

  • Unable to find the correct AIC and BIC while conducting the ADF test. Need solution!

    Hello all,
    I'm using AIC and BIC to find the appropriate lag to be used in the ADF test. The approach I used was to manually write the regression equation corresponding to the dicky fuller equation, and then use the command estat ic. However, the issue I faced was when I used trend in the ADF test. The coefficient of the constant term is different in the ADF test and the regression table, which I found by manually writing the regression equation. Below is the code and also the output. I assume that due to this discrepancy the correct AIC and BIC will be different. How can I resolve this issue?
    Click image for larger version

Name:	Screenshot 2025-05-18 122738.png
Views:	2
Size:	28.9 KB
ID:	1777990
    Click image for larger version

Name:	Screenshot 2025-05-18 123036.png
Views:	2
Size:	32.4 KB
ID:	1777991
    Click image for larger version

Name:	Screenshot 2025-05-18 123053.png
Views:	2
Size:	32.5 KB
ID:	1777992

  • #2
    It's probably how you've defined your trend variable. You should be able to replicate dfuller if you replace year with the following trend variable

    Code:
    sum year
    gen trend = year - r(min)
    See below

    Code:
     webuse air2, clear
    (TIMESLAB: Airline passengers)
    
    .
    .  
    . dfuller air, lags(2) trend regress
    
    Augmented Dickey–Fuller test for unit root
    
    Variable: air                             Number of obs  = 141
                                              Number of lags =   2
    
    H0: Random walk with or without drift
    
                                           Dickey–Fuller
                       Test      -------- critical value ---------
                  statistic           1%           5%          10%
    --------------------------------------------------------------
     Z(t)            -7.085       -4.026       -3.445       -3.145
    --------------------------------------------------------------
    MacKinnon approximate p-value for Z(t) = 0.0000.
    
    Regression table
    ------------------------------------------------------------------------------
           D.air | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             air |
             L1. |  -.4565681   .0644396    -7.09   0.000    -.5840014   -.3291349
             LD. |      .5086   .0745238     6.82   0.000     .3612247    .6559752
            L2D. |   .1033717   .0876976     1.18   0.241    -.0700557    .2767992
                 |
          _trend |   1.232306   .1819661     6.77   0.000     .8724568    1.592155
           _cons |   39.48703   7.153964     5.52   0.000     25.33963    53.63443
    ------------------------------------------------------------------------------
    
    .
    . gen T = _n -1
    
    . reg d.air l.air l(1/2)d.air c.T
    
          Source |       SS           df       MS      Number of obs   =       141
    -------------+----------------------------------   F(4, 136)       =     20.11
           Model |  60062.8156         4  15015.7039   Prob > F        =    0.0000
        Residual |  101570.887       136  746.844754   R-squared       =    0.3716
    -------------+----------------------------------   Adj R-squared   =    0.3531
           Total |  161633.702       140  1154.52644   Root MSE        =    27.328
    
    ------------------------------------------------------------------------------
           D.air | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             air |
             L1. |  -.4565681   .0644396    -7.09   0.000    -.5840014   -.3291349
             LD. |      .5086   .0745238     6.82   0.000     .3612247    .6559752
            L2D. |   .1033717   .0876976     1.18   0.241    -.0700557    .2767992
                 |
               T |   1.232306   .1819661     6.77   0.000     .8724568    1.592155
           _cons |   39.48703   7.153964     5.52   0.000     25.33963    53.63443
    ------------------------------------------------------------------------------
    Last edited by Justin Niakamal; 26 May 2025, 16:33.

    Comment

    Working...
    X