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]

st: RE: dfuller: why do I get different results?


From   Nick Cox <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: dfuller: why do I get different results?
Date   Fri, 18 Nov 2011 11:37:24 +0000

bysort appt: gen reduct1=reduct_per[_n-1]

and 

gen reduct1 = L1.reduct 

give identical results only under certain conditions. One is that sorting by -appt- does _not_ itself guarantee that values for each -appt- are sorted in time order. There can be other problems with omitted observations, etc. 

Use time-series operators after -tsset- to generate lagged variables. 

Nick 
[email protected] 


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Yuval Arbel
Sent: 18 November 2011 11:30
To: statalist
Subject: st: dfuller: why do I get different results?

Dear Statalist Participants,

when I run:

. dfuller reduct_per if appt==2862,noconstant regress

I get the following outcome:

Dickey-Fuller test for unit root                   Number of obs   =        37

                               ---------- Interpolated Dickey-Fuller ---------
                  Test         1% Critical       5% Critical      10% Critical
               Statistic           Value             Value             Value
------------------------------------------------------------------------------
 Z(t)             -6.026            -2.641            -1.950            -1.605

------------------------------------------------------------------------------
D.reduct_per |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  reduct_per |
         L1. |  -.5409015   .0897625    -6.03   0.000    -.7229484   -.3588546
------------------------------------------------------------------------------

Those outcomes imply that the calculated statistic for the unit-root
test is -6.03

But when I define:

bysort appt: gen reduct1=reduct_per[_n-1]
bysort appt: gen dreduct1=reduct_per-reduct_per[_n-1]

and I run:


regress dreduct1 reduct1 if appt==2862,noconst

I get:

. regress dreduct1 reduct1  if appt==2862,noconst

      Source |       SS       df       MS              Number of obs =      36
-------------+------------------------------           F(  1,    35) =    0.00
       Model |           0     1           0           Prob > F      =  1.0000
    Residual |         625    35  17.8571429           R-squared     =  0.0000
-------------+------------------------------           Adj R-squared = -0.0286
       Total |         625    36  17.3611111           Root MSE      =  4.2258

------------------------------------------------------------------------------
    dreduct1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
     reduct1 |          0   .0509647     0.00   1.000    -.1034639    .1034639
------------------------------------------------------------------------------

.
Shouldn't I get exactly the same outcomes in both regressions?


*
*   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