Announcement

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

  • dfuller regress result vs linear regression result

    Dear All,
    I am a beginner in Stata, and I was performing an augmented Dickey-Fuller test for the production index data (the data is attached as an excel file). It is a monthly series, so I’ve converted it to the quarterly series after importing this data to Stata. Below is the code I’ve run after importing the data:

    Code:
    gen Time = qofd(Date)
    format Time %tq
    collapse (mean) INDPRO, by(Time)
    gen time = _n
    tsset time
    gen yt = log(INDPRO)
    gen ytmin1 = yt[_n-1]
    gen Delta_yt = D.yt
    gen Delta_ytmin1 = Delta_yt[_n-1]
    dfuller yt, lags(1) trend regress
    regress Delta_yt time ytmin1 Delta_ytmin1
    I’m puzzled that the linear regression constant coefficient estimate is somewhat different from the one generated after dfuller command: .3369282 vs .3381812. Shouldn’t they be identical? Perhaps I lack knowledge of how this test work and/or there is an error in my code. Can you kindly help me find out? Many thanks.
    Attached Files
    Last edited by Alex Tekin; 29 Mar 2024, 17:37.

  • #2
    -dfuller- substracts the minimum from the time variable before regress (also -dataex- is the prefer means of producing an example dataset).

    Compare:

    Code:
    webuse air2,clear
    dfuller air, lags(1) trend regress
    
    qui reg D.air L.air DL(1/1).air t
    estimates store regress
    sum t, meanonly
    replace t = t -r(min)
    tsset t
    qui reg D.air L.air DL(1/1).air t
    estimates store dicky_fuller
    estimates table regress dicky_fuller, b(%9.4f) modelwidth(14)

    Comment


    • #3
      [QUOTE=Scott Merryman;n1748291]-dfuller- substracts the minimum from the time variable before regress
      Thank you Scott. Can you please explain why does dfuller have to do that? Because in a simple linear regression with time variable, we are just including time which equals _n, right? Because doing so obviously creates inconsistency between dfuller regress and linear regression coefficients. Perhaps I am including trend incorrectly. Thank you.

      Comment


      • #4
        Why does Stata's dfuller adjust the time trend so it starts at zero? I don't know.

        Does it create an inconsistency? No, all the estimated coefficient (except for the intercept) and predicted values are the same. In interpreting the intercept you have to keep in mind that the time trend has been adjusted.


        Code:
        ------------------------------------------------
            Variable |    regress        dicky_fuller   
        -------------+----------------------------------
                   t |         2.6572           2.6572  
               _cons |        87.6528          90.3100  
        ------------------------------------------------
        
        . list air t_orig xb1 t xb2 in 1/3,
        
             +----------------------------------------+
             | air   t_orig        xb1   t        xb2 |
             |----------------------------------------|
          1. | 112        1   90.30996   0   90.30996 |
          2. | 118        2   92.96715   1   92.96715 |
          3. | 132        3   95.62433   2   95.62433 |
        Code:
        webuse air2,clear
        quietly {
            reg air  t
            predict xb1
            estimates store regress
            clonevar t_orig = t
            sum t, meanonly
            replace t =  t - r(min)
            reg air  t
            predict xb2
            estimates store dicky_fuller
        }
        estimates table regress dicky_fuller, b(%9.4f) modelwidth(14) 
        list air t_orig xb1 t xb2 in 1/3,

        Comment

        Working...
        X