-------------
      name:  <unnamed>
       log:  f:\statadat\cs_egranger.smcl
  log type:  smcl
 opened on:  16 Aug 2012, 22:38:27

. which egranger
c:\ado\personal\egranger.ado
*! egranger version 1.0.3  16Aug2012
*! author Mark Schaffer

. version
version 11.2

.
. * average per-capita disposable personal income dataset
. use http://www.stata-press.com/data/r9/rdinc, clear

.
. * T is zero in the first period (lost in 2nd step and test regressions)
. gen t=_n-1

. gen tsq=t^2

.
. * Cointegration test
.
. egranger ln_ne ln_se, regress

Engle-Granger test for cointegration                  N (1st step)  =       55
                                                      N (test)      =       54
------------------------------------------------------------------------------
                  Test         1% Critical       5% Critical      10% Critical
               Statistic           Value             Value             Value
------------------------------------------------------------------------------
 Z(t)             -0.469            -3.558            -2.917            -2.596

Critical values from MacKinnon (1990, 2010)
------------------------------------------------------------------------------
Engle-Granger 1st-step regression
-------------+----------------------------------------------------------------
        ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       ln_se |    .9480494    .0058975    160.76    0.000      .9362206     .9598782
       _cons |    .7178752    .0503722     14.25    0.000      .6168413     .8189091
-------------+----------------------------------------------------------------
Engle-Granger test regression
-------------+----------------------------------------------------------------
   D._egresid |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
    _egresid |
         L1. |   -.0184894    .0394634     -0.47    0.641     -.0976428     .0606641
-------------+----------------------------------------------------------------

. scalar Zt=e(Zt)

. capture drop resid

. regress ln_ne ln_se

      Source |       SS       df       MS              Number of obs =      55
-------------+------------------------------           F(  1,    53) =25842.40
       Model |  59.2458578     1  59.2458578           Prob > F      =  0.0000
    Residual |  .121506903    53  .002292583           R-squared     =  0.9980
-------------+------------------------------           Adj R-squared =  0.9979
       Total |  59.3673647    54  1.09939564           Root MSE      =  .04788

-------------+----------------------------------------------------------------
        ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       ln_se |    .9480494    .0058975    160.76    0.000      .9362206     .9598782
       _cons |    .7178752    .0503722     14.25    0.000      .6168413     .8189091
-------------+----------------------------------------------------------------

. predict double resid, res

. regress D.resid L.resid, nocons

      Source |       SS       df       MS              Number of obs =      54
-------------+------------------------------           F(  1,    53) =    0.22
       Model |  .000039678     1  .000039678           Prob > F      =  0.6413
    Residual |  .009580086    53  .000180756           R-squared     =  0.0041
-------------+------------------------------           Adj R-squared = -0.0147
       Total |  .009619764    54  .000178144           Root MSE      =  .01344

-------------+----------------------------------------------------------------
      D.resid |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       resid |
         L1. |   -.0184894    .0394634     -0.47    0.641     -.0976428     .0606641
-------------+----------------------------------------------------------------

. qui test L.resid

. assert reldif(abs(Zt),sqrt(r(F))) < 1e-8

.
. egranger ln_ne ln_se, lags(2) regress
Replacing variable _egresid...

Augmented Engle-Granger test for cointegration        N (1st step)  =       55
Number of lags   =  2                                 N (test)      =       52
------------------------------------------------------------------------------
                  Test         1% Critical       5% Critical      10% Critical
               Statistic           Value             Value             Value
------------------------------------------------------------------------------
 Z(t)             -1.336            -3.558            -2.917            -2.596

Critical values from MacKinnon (1990, 2010)
------------------------------------------------------------------------------
Engle-Granger 1st-step regression
-------------+----------------------------------------------------------------
        ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       ln_se |    .9480494    .0058975    160.76    0.000      .9362206     .9598782
       _cons |    .7178752    .0503722     14.25    0.000      .6168413     .8189091
-------------+----------------------------------------------------------------
Engle-Granger test regression
-------------+----------------------------------------------------------------
   D._egresid |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
    _egresid |
         L1. |    -.050771    .0379952     -1.34    0.188     -.1271252     .0255831
         LD. |     .358361    .1367238      2.62    0.012      .0836042     .6331178
        L2D. |    .0658113    .1399569      0.47    0.640     -.2154426     .3470653
-------------+----------------------------------------------------------------

. scalar Zt=e(Zt)

. capture drop resid

. regress ln_ne ln_se

      Source |       SS       df       MS              Number of obs =      55
-------------+------------------------------           F(  1,    53) =25842.40
       Model |  59.2458578     1  59.2458578           Prob > F      =  0.0000
    Residual |  .121506903    53  .002292583           R-squared     =  0.9980
-------------+------------------------------           Adj R-squared =  0.9979
       Total |  59.3673647    54  1.09939564           Root MSE      =  .04788

-------------+----------------------------------------------------------------
        ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       ln_se |    .9480494    .0058975    160.76    0.000      .9362206     .9598782
       _cons |    .7178752    .0503722     14.25    0.000      .6168413     .8189091
-------------+----------------------------------------------------------------

. predict double resid, res

. regress D.resid L.resid L(1/2)D.resid, nocons

      Source |       SS       df       MS              Number of obs =      52
-------------+------------------------------           F(  3,    49) =    3.12
       Model |  .001407853     3  .000469284           Prob > F      =  0.0345
    Residual |  .007381708    49  .000150647           R-squared     =  0.1602
-------------+------------------------------           Adj R-squared =  0.1088
       Total |  .008789561    52   .00016903           Root MSE      =  .01227

-------------+----------------------------------------------------------------
      D.resid |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       resid |
         L1. |    -.050771    .0379952     -1.34    0.188     -.1271252     .0255831
         LD. |     .358361    .1367238      2.62    0.012      .0836042     .6331178
        L2D. |    .0658113    .1399569      0.47    0.640     -.2154426     .3470653
-------------+----------------------------------------------------------------

. qui test L.resid

. assert reldif(abs(Zt),sqrt(r(F))) < 1e-8

.
. egranger ln_ne ln_se ln_me, lags(2) regress
Replacing variable _egresid...

Augmented Engle-Granger test for cointegration        N (1st step)  =       55
Number of lags   =  2                                 N (test)      =       52
------------------------------------------------------------------------------
                  Test         1% Critical       5% Critical      10% Critical
               Statistic           Value             Value             Value
------------------------------------------------------------------------------
 Z(t)             -3.294            -4.107            -3.452            -3.124

Critical values from MacKinnon (1990, 2010)
------------------------------------------------------------------------------
Engle-Granger 1st-step regression
-------------+----------------------------------------------------------------
        ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       ln_se |   -.2213408     .052206     -4.24    0.000     -.3260998    -.1165818
       ln_me |    1.271222    .0567175     22.41    0.000       1.15741     1.385034
       _cons |   -.5177237    .0572861     -9.04    0.000     -.6326767    -.4027706
-------------+----------------------------------------------------------------
Engle-Granger test regression
-------------+----------------------------------------------------------------
   D._egresid |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
    _egresid |
         L1. |   -.3233623    .0981799     -3.29    0.002     -.5206623    -.1260624
         LD. |       .3137    .1233709      2.54    0.014      .0657768     .5616231
        L2D. |   -.1488599    .1303368     -1.14    0.259     -.4107814     .1130616
-------------+----------------------------------------------------------------

. scalar Zt=e(Zt)

. capture drop resid

. regress ln_ne ln_se ln_me

      Source |       SS       df       MS              Number of obs =      55
-------------+------------------------------           F(  2,    52) =       .
       Model |   59.355967     2  29.6779835           Prob > F      =  0.0000
    Residual |  .011397736    52  .000219187           R-squared     =  0.9998
-------------+------------------------------           Adj R-squared =  0.9998
       Total |  59.3673647    54  1.09939564           Root MSE      =   .0148

-------------+----------------------------------------------------------------
        ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       ln_se |   -.2213408     .052206     -4.24    0.000     -.3260998    -.1165818
       ln_me |    1.271222    .0567175     22.41    0.000       1.15741     1.385034
       _cons |   -.5177237    .0572861     -9.04    0.000     -.6326767    -.4027706
-------------+----------------------------------------------------------------

. predict double resid, res

. regress D.resid L.resid L(1/2)D.resid, nocons

      Source |       SS       df       MS              Number of obs =      52
-------------+------------------------------           F(  3,    49) =    6.87
       Model |  .001424504     3  .000474835           Prob > F      =  0.0006
    Residual |  .003387013    49  .000069123           R-squared     =  0.2961
-------------+------------------------------           Adj R-squared =  0.2530
       Total |  .004811517    52  .000092529           Root MSE      =  .00831

-------------+----------------------------------------------------------------
      D.resid |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       resid |
         L1. |   -.3233623    .0981799     -3.29    0.002     -.5206623    -.1260624
         LD. |       .3137    .1233709      2.54    0.014      .0657768     .5616231
        L2D. |   -.1488599    .1303368     -1.14    0.259     -.4107814     .1130616
-------------+----------------------------------------------------------------

. qui test L.resid

. assert reldif(abs(Zt),sqrt(r(F))) < 1e-8

.
. egranger ln_ne ln_se, lags(3) regress trend
Replacing variable _egresid...

Augmented Engle-Granger test for cointegration        N (1st step)  =       55
Number of lags   =  3                                 N (test)      =       51
1st step includes linear trend
------------------------------------------------------------------------------
                  Test         1% Critical       5% Critical      10% Critical
               Statistic           Value             Value             Value
------------------------------------------------------------------------------
 Z(t)             -1.559            -4.137            -3.495            -3.176

Critical values from MacKinnon (1990, 2010)
------------------------------------------------------------------------------
Engle-Granger 1st-step regression
-------------+----------------------------------------------------------------
        ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       ln_se |    .9179047    .0491845     18.66    0.000      .8192089     1.016601
      _trend |    .0020942    .0033919      0.62    0.540     -.0047122     .0089005
       _cons |    .9166857    .3259759      2.81    0.007      .2625672     1.570804
-------------+----------------------------------------------------------------
Engle-Granger test regression
-------------+----------------------------------------------------------------
   D._egresid |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
    _egresid |
         L1. |    -.058504    .0375381     -1.56    0.126      -.134021     .0170129
         LD. |    .4161955    .1367298      3.04    0.004      .1411307     .6912603
        L2D. |    .0098615    .1413458      0.07    0.945     -.2744895     .2942126
        L3D. |    .1797595    .1374333      1.31    0.197     -.0967206     .4562395
-------------+----------------------------------------------------------------

. scalar Zt=e(Zt)

. capture drop resid

. regress ln_ne ln_se t

      Source |       SS       df       MS              Number of obs =      55
-------------+------------------------------           F(  2,    52) =12770.53
       Model |   59.246742     2   29.623371           Prob > F      =  0.0000
    Residual |  .120622693    52  .002319667           R-squared     =  0.9980
-------------+------------------------------           Adj R-squared =  0.9979
       Total |  59.3673647    54  1.09939564           Root MSE      =  .04816

-------------+----------------------------------------------------------------
        ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       ln_se |    .9179047    .0491845     18.66    0.000      .8192089     1.016601
           t |    .0020942    .0033919      0.62    0.540     -.0047122     .0089005
       _cons |    .9166857    .3259759      2.81    0.007      .2625672     1.570804
-------------+----------------------------------------------------------------

. predict double resid, res

. regress D.resid L.resid L(1/3)D.resid, nocons

      Source |       SS       df       MS              Number of obs =      51
-------------+------------------------------           F(  4,    47) =    3.50
       Model |  .001952309     4  .000488077           Prob > F      =  0.0139
    Residual |  .006550765    47  .000139378           R-squared     =  0.2296
-------------+------------------------------           Adj R-squared =  0.1640
       Total |  .008503074    51  .000166727           Root MSE      =  .01181

-------------+----------------------------------------------------------------
      D.resid |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       resid |
         L1. |    -.058504    .0375381     -1.56    0.126      -.134021     .0170129
         LD. |    .4161955    .1367298      3.04    0.004      .1411307     .6912603
        L2D. |    .0098615    .1413458      0.07    0.945     -.2744895     .2942126
        L3D. |    .1797595    .1374333      1.31    0.197     -.0967206     .4562395
-------------+----------------------------------------------------------------

. qui test L.resid

. assert reldif(abs(Zt),sqrt(r(F))) < 1e-8

.
. egranger ln_ne ln_se ln_me, lags(4) regress qtrend
Replacing variable _egresid...

Augmented Engle-Granger test for cointegration        N (1st step)  =       55
Number of lags   =  4                                 N (test)      =       50
1st step includes quadratic trend
------------------------------------------------------------------------------
                  Test         1% Critical       5% Critical      10% Critical
               Statistic           Value             Value             Value
------------------------------------------------------------------------------
 Z(t)             -3.655            -5.089            -4.410            -4.073

Critical values from MacKinnon (1990, 2010)
------------------------------------------------------------------------------
Engle-Granger 1st-step regression
-------------+----------------------------------------------------------------
        ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       ln_se |   -.4853195    .0829014     -5.85    0.000     -.6518318    -.3188071
       ln_me |    1.532462    .0900714     17.01    0.000      1.351548     1.713375
      _trend |    .0043097    .0011442      3.77    0.000      .0020114     .0066079
    _trend^2 |   -.0000493    .0000141     -3.50    0.001     -.0000776     -.000021
       _cons |   -.6391797    .1337661     -4.78    0.000     -.9078567    -.3705026
-------------+----------------------------------------------------------------
Engle-Granger test regression
-------------+----------------------------------------------------------------
   D._egresid |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
    _egresid |
         L1. |    -.605947    .1657767     -3.66    0.001     -.9398383    -.2720556
         LD. |    .3424608    .1665914      2.06    0.046      .0069285     .6779931
        L2D. |    .0629834    .1552987      0.41    0.687     -.2498043     .3757711
        L3D. |    .1640868    .1299853      1.26    0.213     -.0977171     .4258907
        L4D. |    .2312064    .1299288      1.78    0.082     -.0304836     .4928965
-------------+----------------------------------------------------------------

. scalar Zt=e(Zt)

. capture drop resid

. regress ln_ne ln_se ln_me t tsq

      Source |       SS       df       MS              Number of obs =      55
-------------+------------------------------           F(  4,    50) =86783.30
       Model |  59.3588148     4  14.8397037           Prob > F      =  0.0000
    Residual |  .008549861    50  .000170997           R-squared     =  0.9999
-------------+------------------------------           Adj R-squared =  0.9998
       Total |  59.3673647    54  1.09939564           Root MSE      =  .01308

-------------+----------------------------------------------------------------
        ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       ln_se |   -.4853195    .0829014     -5.85    0.000     -.6518318    -.3188071
       ln_me |    1.532462    .0900714     17.01    0.000      1.351548     1.713375
           t |    .0043097    .0011442      3.77    0.000      .0020114     .0066079
         tsq |   -.0000493    .0000141     -3.50    0.001     -.0000776     -.000021
       _cons |   -.6391797    .1337661     -4.78    0.000     -.9078567    -.3705026
-------------+----------------------------------------------------------------

. predict double resid, res

. regress D.resid L.resid L(1/4)D.resid, nocons

      Source |       SS       df       MS              Number of obs =      50
-------------+------------------------------           F(  5,    45) =    4.35
       Model |  .001723709     5  .000344742           Prob > F      =  0.0026
    Residual |  .003568661    45  .000079304           R-squared     =  0.3257
-------------+------------------------------           Adj R-squared =  0.2508
       Total |  .005292371    50  .000105847           Root MSE      =  .00891

-------------+----------------------------------------------------------------
      D.resid |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       resid |
         L1. |    -.605947    .1657767     -3.66    0.001     -.9398383    -.2720556
         LD. |    .3424608    .1665914      2.06    0.046      .0069285     .6779931
        L2D. |    .0629834    .1552987      0.41    0.687     -.2498043     .3757711
        L3D. |    .1640868    .1299853      1.26    0.213     -.0977171     .4258907
        L4D. |    .2312064    .1299288      1.78    0.082     -.0304836     .4928965
-------------+----------------------------------------------------------------

. qui test L.resid

. assert reldif(abs(Zt),sqrt(r(F))) < 1e-8

.
. * 2-step ECM
.
. egranger ln_ne ln_se, regress ecm
Replacing variable _egresid...

Engle-Granger 2-step ECM estimation                   N (1st step)  =       55
                                                      N (2nd step)  =       53

Engle-Granger 1st-step regression
-------------+----------------------------------------------------------------
        ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       ln_se |    .9480494    .0058975    160.76    0.000      .9362206     .9598782
       _cons |    .7178752    .0503722     14.25    0.000      .6168413     .8189091
-------------+----------------------------------------------------------------

Engle-Granger 2-step ECM
-------------+----------------------------------------------------------------
      D.ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
    _egresid |
         L1. |   -.3960699    .0801533     -4.94    0.000     -.5570624    -.2350773
             |
       ln_se |
         LD. |   -.0118925    .1296342     -0.09    0.927     -.2722706     .2484855
             |
       _cons |     .060085    .0082891      7.25    0.000      .0434358     .0767341
-------------+----------------------------------------------------------------

. savedresults save eg e()

. capture drop resid

. regress ln_ne ln_se

      Source |       SS       df       MS              Number of obs =      55
-------------+------------------------------           F(  1,    53) =25842.40
       Model |  59.2458578     1  59.2458578           Prob > F      =  0.0000
    Residual |  .121506903    53  .002292583           R-squared     =  0.9980
-------------+------------------------------           Adj R-squared =  0.9979
       Total |  59.3673647    54  1.09939564           Root MSE      =  .04788

-------------+----------------------------------------------------------------
        ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       ln_se |    .9480494    .0058975    160.76    0.000      .9362206     .9598782
       _cons |    .7178752    .0503722     14.25    0.000      .6168413     .8189091
-------------+----------------------------------------------------------------

. predict double resid, res

. regress D.ln_ne L.resid LD.ln_se

      Source |       SS       df       MS              Number of obs =      53
-------------+------------------------------           F(  2,    50) =   22.10
       Model |  .017716673     2  .008858336           Prob > F      =  0.0000
    Residual |  .020040417    50  .000400808           R-squared     =  0.4692
-------------+------------------------------           Adj R-squared =  0.4480
       Total |   .03775709    52  .000726098           Root MSE      =  .02002

-------------+----------------------------------------------------------------
      D.ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       resid |
         L1. |   -.3960699    .0801533     -4.94    0.000     -.5570624    -.2350773
             |
       ln_se |
         LD. |   -.0118925    .1296342     -0.09    0.927     -.2722706     .2484855
             |
       _cons |     .060085    .0082891      7.25    0.000      .0434358     .0767341
-------------+----------------------------------------------------------------

. savedresults comp eg e(), include(macros: depvar scalar: ll matrix: b V) tol(1e-7) verbose
comparing macro  e(depvar)
comparing scalar e(ll)
comparing matrix e(b)
comparing matrix e(V)

.
. egranger ln_ne ln_se, lags(2) regress ecm
Replacing variable _egresid...

Engle-Granger 2-step ECM estimation                   N (1st step)  =       55
Number of lags   =  2                                 N (2nd step)  =       52

Engle-Granger 1st-step regression
-------------+----------------------------------------------------------------
        ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       ln_se |    .9480494    .0058975    160.76    0.000      .9362206     .9598782
       _cons |    .7178752    .0503722     14.25    0.000      .6168413     .8189091
-------------+----------------------------------------------------------------

Engle-Granger 2-step ECM
-------------+----------------------------------------------------------------
      D.ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
    _egresid |
         L1. |    -.465695    .0881672     -5.28    0.000     -.6431663    -.2882237
             |
       ln_ne |
         LD. |    .5168296    .1846592      2.80    0.007        .14513     .8885292
        L2D. |    .3684522    .2002311      1.84    0.072     -.0345921     .7714965
             |
       ln_se |
         LD. |   -.3773024    .2080446     -1.81    0.076     -.7960744     .0414696
        L2D. |   -.4641549    .2242527     -2.07    0.044     -.9155521    -.0127577
             |
       _cons |    .0575856    .0102661      5.61    0.000       .036921     .0782501
-------------+----------------------------------------------------------------

. savedresults save eg e()

. capture drop resid

. regress ln_ne ln_se

      Source |       SS       df       MS              Number of obs =      55
-------------+------------------------------           F(  1,    53) =25842.40
       Model |  59.2458578     1  59.2458578           Prob > F      =  0.0000
    Residual |  .121506903    53  .002292583           R-squared     =  0.9980
-------------+------------------------------           Adj R-squared =  0.9979
       Total |  59.3673647    54  1.09939564           Root MSE      =  .04788

-------------+----------------------------------------------------------------
        ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       ln_se |    .9480494    .0058975    160.76    0.000      .9362206     .9598782
       _cons |    .7178752    .0503722     14.25    0.000      .6168413     .8189091
-------------+----------------------------------------------------------------

. predict double resid, res

. regress D.ln_ne L.resid L(1/2)D.(ln_ne ln_se)

      Source |       SS       df       MS              Number of obs =      52
-------------+------------------------------           F(  5,    46) =   17.62
       Model |  .023882781     5  .004776556           Prob > F      =  0.0000
    Residual |   .01247218    46  .000271134           R-squared     =  0.6569
-------------+------------------------------           Adj R-squared =  0.6196
       Total |  .036354961    51  .000712842           Root MSE      =  .01647

-------------+----------------------------------------------------------------
      D.ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       resid |
         L1. |    -.465695    .0881672     -5.28    0.000     -.6431663    -.2882237
             |
       ln_ne |
         LD. |    .5168296    .1846592      2.80    0.007        .14513     .8885292
        L2D. |    .3684522    .2002311      1.84    0.072     -.0345921     .7714965
             |
       ln_se |
         LD. |   -.3773024    .2080446     -1.81    0.076     -.7960744     .0414696
        L2D. |   -.4641549    .2242527     -2.07    0.044     -.9155521    -.0127577
             |
       _cons |    .0575856    .0102661      5.61    0.000       .036921     .0782501
-------------+----------------------------------------------------------------

. savedresults comp eg e(), include(macros: depvar scalar: ll matrix: b V) tol(1e-7) verbose
comparing macro  e(depvar)
comparing scalar e(ll)
comparing matrix e(b)
comparing matrix e(V)

.
. egranger ln_ne ln_se ln_me, lags(2) regress ecm
Replacing variable _egresid...

Engle-Granger 2-step ECM estimation                   N (1st step)  =       55
Number of lags   =  2                                 N (2nd step)  =       52

Engle-Granger 1st-step regression
-------------+----------------------------------------------------------------
        ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       ln_se |   -.2213408     .052206     -4.24    0.000     -.3260998    -.1165818
       ln_me |    1.271222    .0567175     22.41    0.000       1.15741     1.385034
       _cons |   -.5177237    .0572861     -9.04    0.000     -.6326767    -.4027706
-------------+----------------------------------------------------------------

Engle-Granger 2-step ECM
-------------+----------------------------------------------------------------
      D.ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
    _egresid |
         L1. |    .0185838    .2311312      0.08    0.936     -.4472305     .4843981
             |
       ln_ne |
         LD. |    1.172207    .3532043      3.32    0.002      .4603705     1.884044
        L2D. |   -.9525821    .3785131     -2.52    0.016     -1.715425    -.1897391
             |
       ln_se |
         LD. |    .0463373    .2304711      0.20    0.842     -.4181468     .5108214
        L2D. |    .1298701      .23288      0.56    0.580     -.3394688     .5992089
             |
       ln_me |
         LD. |   -.7416296    .3857938     -1.92    0.061     -1.519146     .0358868
        L2D. |    1.152581    .3907056      2.95    0.005      .3651654     1.939996
             |
       _cons |     .011312    .0074394      1.52    0.136     -.0036811     .0263051
-------------+----------------------------------------------------------------

. savedresults save eg e()

. capture drop resid

. regress ln_ne ln_se ln_me

      Source |       SS       df       MS              Number of obs =      55
-------------+------------------------------           F(  2,    52) =       .
       Model |   59.355967     2  29.6779835           Prob > F      =  0.0000
    Residual |  .011397736    52  .000219187           R-squared     =  0.9998
-------------+------------------------------           Adj R-squared =  0.9998
       Total |  59.3673647    54  1.09939564           Root MSE      =   .0148

-------------+----------------------------------------------------------------
        ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       ln_se |   -.2213408     .052206     -4.24    0.000     -.3260998    -.1165818
       ln_me |    1.271222    .0567175     22.41    0.000       1.15741     1.385034
       _cons |   -.5177237    .0572861     -9.04    0.000     -.6326767    -.4027706
-------------+----------------------------------------------------------------

. predict double resid, res

. regress D.ln_ne L.resid L(1/2)D.(ln_ne ln_se ln_me)

      Source |       SS       df       MS              Number of obs =      52
-------------+------------------------------           F(  7,    44) =    8.42
       Model |  .020812887     7   .00297327           Prob > F      =  0.0000
    Residual |  .015542074    44  .000353229           R-squared     =  0.5725
-------------+------------------------------           Adj R-squared =  0.5045
       Total |  .036354961    51  .000712842           Root MSE      =  .01879

-------------+----------------------------------------------------------------
      D.ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       resid |
         L1. |    .0185838    .2311312      0.08    0.936     -.4472305     .4843981
             |
       ln_ne |
         LD. |    1.172207    .3532043      3.32    0.002      .4603705     1.884044
        L2D. |   -.9525821    .3785131     -2.52    0.016     -1.715425    -.1897391
             |
       ln_se |
         LD. |    .0463373    .2304711      0.20    0.842     -.4181468     .5108214
        L2D. |    .1298701      .23288      0.56    0.580     -.3394688     .5992089
             |
       ln_me |
         LD. |   -.7416296    .3857938     -1.92    0.061     -1.519146     .0358868
        L2D. |    1.152581    .3907056      2.95    0.005      .3651654     1.939996
             |
       _cons |     .011312    .0074394      1.52    0.136     -.0036811     .0263051
-------------+----------------------------------------------------------------

. savedresults comp eg e(), include(macros: depvar scalar: ll matrix: b V) tol(1e-7) verbose
comparing macro  e(depvar)
comparing scalar e(ll)
comparing matrix e(b)
comparing matrix e(V)

.
. egranger ln_ne ln_se, lags(3) regress trend ecm
Replacing variable _egresid...

Engle-Granger 2-step ECM estimation                   N (1st step)  =       55
Number of lags   =  3                                 N (2nd step)  =       51
1st step includes linear trend

Engle-Granger 1st-step regression
-------------+----------------------------------------------------------------
        ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       ln_se |    .9179047    .0491845     18.66    0.000      .8192089     1.016601
      _trend |    .0020942    .0033919      0.62    0.540     -.0047122     .0089005
       _cons |    .9166857    .3259759      2.81    0.007      .2625672     1.570804
-------------+----------------------------------------------------------------

Engle-Granger 2-step ECM
-------------+----------------------------------------------------------------
      D.ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
    _egresid |
         L1. |    -.480883    .1111211     -4.33    0.000     -.7049801    -.2567859
             |
       ln_ne |
         LD. |    .4518776    .1957369      2.31    0.026      .0571364     .8466187
        L2D. |    .4163629    .2058533      2.02    0.049      .0012202     .8315057
        L3D. |    .1226279    .2132233      0.58    0.568     -.3073779     .5526336
             |
       ln_se |
         LD. |   -.4002946    .2176546     -1.84    0.073      -.839237     .0386478
        L2D. |   -.4379454    .2292312     -1.91    0.063     -.9002341     .0243434
        L3D. |   -.0764107    .2367552     -0.32    0.748      -.553873     .4010516
             |
       _cons |    .0553389    .0128391      4.31    0.000      .0294465     .0812314
-------------+----------------------------------------------------------------

. savedresults save eg e()

. capture drop resid

. regress ln_ne ln_se t

      Source |       SS       df       MS              Number of obs =      55
-------------+------------------------------           F(  2,    52) =12770.53
       Model |   59.246742     2   29.623371           Prob > F      =  0.0000
    Residual |  .120622693    52  .002319667           R-squared     =  0.9980
-------------+------------------------------           Adj R-squared =  0.9979
       Total |  59.3673647    54  1.09939564           Root MSE      =  .04816

-------------+----------------------------------------------------------------
        ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       ln_se |    .9179047    .0491845     18.66    0.000      .8192089     1.016601
           t |    .0020942    .0033919      0.62    0.540     -.0047122     .0089005
       _cons |    .9166857    .3259759      2.81    0.007      .2625672     1.570804
-------------+----------------------------------------------------------------

. predict double resid, res

. regress D.ln_ne L.resid L(1/3)D.(ln_ne ln_se)

      Source |       SS       df       MS              Number of obs =      51
-------------+------------------------------           F(  7,    43) =   12.95
       Model |  .024334864     7  .003476409           Prob > F      =  0.0000
    Residual |   .01153966    43  .000268364           R-squared     =  0.6783
-------------+------------------------------           Adj R-squared =  0.6260
       Total |  .035874524    50   .00071749           Root MSE      =  .01638

-------------+----------------------------------------------------------------
      D.ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       resid |
         L1. |    -.480883    .1111211     -4.33    0.000     -.7049801    -.2567859
             |
       ln_ne |
         LD. |    .4518776    .1957369      2.31    0.026      .0571364     .8466187
        L2D. |    .4163629    .2058533      2.02    0.049      .0012202     .8315057
        L3D. |    .1226279    .2132233      0.58    0.568     -.3073779     .5526336
             |
       ln_se |
         LD. |   -.4002946    .2176546     -1.84    0.073      -.839237     .0386478
        L2D. |   -.4379454    .2292312     -1.91    0.063     -.9002341     .0243434
        L3D. |   -.0764107    .2367552     -0.32    0.748      -.553873     .4010516
             |
       _cons |    .0553389    .0128391      4.31    0.000      .0294465     .0812314
-------------+----------------------------------------------------------------

. savedresults comp eg e(), include(macros: depvar scalar: ll matrix: b V) tol(1e-7) verbose
comparing macro  e(depvar)
comparing scalar e(ll)
comparing matrix e(b)
comparing matrix e(V)

.
. egranger ln_ne ln_se ln_me, lags(4) regress qtrend ecm
Replacing variable _egresid...

Engle-Granger 2-step ECM estimation                   N (1st step)  =       55
Number of lags   =  4                                 N (2nd step)  =       50
1st step includes quadratic trend

Engle-Granger 1st-step regression
-------------+----------------------------------------------------------------
        ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       ln_se |   -.4853195    .0829014     -5.85    0.000     -.6518318    -.3188071
       ln_me |    1.532462    .0900714     17.01    0.000      1.351548     1.713375
      _trend |    .0043097    .0011442      3.77    0.000      .0020114     .0066079
    _trend^2 |   -.0000493    .0000141     -3.50    0.001     -.0000776     -.000021
       _cons |   -.6391797    .1337661     -4.78    0.000     -.9078567    -.3705026
-------------+----------------------------------------------------------------

Engle-Granger 2-step ECM
-------------+----------------------------------------------------------------
      D.ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
    _egresid |
         L1. |   -.3499235    .4336711     -0.81    0.425     -1.229449     .5296022
             |
       ln_ne |
         LD. |    1.557219    .4505869      3.46    0.001      .6433868     2.471052
        L2D. |    .0145884    .4795908      0.03    0.976     -.9580669     .9872437
        L3D. |   -.1269116    .4169611     -0.30    0.763     -.9725478     .7187247
        L4D. |    .7074878    .4284787      1.65    0.107     -.1615073     1.576483
             |
       ln_se |
         LD. |    .6462859    .2982597      2.17    0.037      .0413872     1.251185
        L2D. |    .1420399    .2307202      0.62    0.542     -.3258823      .609962
        L3D. |    .3932306    .2305856      1.71    0.097     -.0744186     .8608798
        L4D. |    .0388579    .2443514      0.16    0.875     -.4567097     .5344254
             |
       ln_me |
         LD. |   -1.903652    .5942154     -3.20    0.003     -3.108777    -.6985275
        L2D. |    .2178245    .5062558      0.43    0.670     -.8089099     1.244559
        L3D. |   -.2640008    .4292576     -0.62    0.542     -1.134576     .6065739
        L4D. |   -.6087006    .4256548     -1.43    0.161     -1.471968     .2545672
             |
       _cons |    .0025171    .0070279      0.36    0.722     -.0117361     .0167703
-------------+----------------------------------------------------------------

. savedresults save eg e()

. capture drop resid

. regress ln_ne ln_se ln_me t tsq

      Source |       SS       df       MS              Number of obs =      55
-------------+------------------------------           F(  4,    50) =86783.30
       Model |  59.3588148     4  14.8397037           Prob > F      =  0.0000
    Residual |  .008549861    50  .000170997           R-squared     =  0.9999
-------------+------------------------------           Adj R-squared =  0.9998
       Total |  59.3673647    54  1.09939564           Root MSE      =  .01308

-------------+----------------------------------------------------------------
        ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       ln_se |   -.4853195    .0829014     -5.85    0.000     -.6518318    -.3188071
       ln_me |    1.532462    .0900714     17.01    0.000      1.351548     1.713375
           t |    .0043097    .0011442      3.77    0.000      .0020114     .0066079
         tsq |   -.0000493    .0000141     -3.50    0.001     -.0000776     -.000021
       _cons |   -.6391797    .1337661     -4.78    0.000     -.9078567    -.3705026
-------------+----------------------------------------------------------------

. predict double resid, res

. regress D.ln_ne L.resid L(1/4)D.(ln_ne ln_se ln_me)

      Source |       SS       df       MS              Number of obs =      50
-------------+------------------------------           F( 13,    36) =    7.27
       Model |  .025473081    13  .001959468           Prob > F      =  0.0000
    Residual |  .009704339    36  .000269565           R-squared     =  0.7241
-------------+------------------------------           Adj R-squared =  0.6245
       Total |   .03517742    49  .000717907           Root MSE      =  .01642

-------------+----------------------------------------------------------------
      D.ln_ne |      Coef.    Std. Err.       t    P>|t|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       resid |
         L1. |   -.3499235    .4336711     -0.81    0.425     -1.229449     .5296022
             |
       ln_ne |
         LD. |    1.557219    .4505869      3.46    0.001      .6433868     2.471052
        L2D. |    .0145884    .4795908      0.03    0.976     -.9580669     .9872437
        L3D. |   -.1269116    .4169611     -0.30    0.763     -.9725478     .7187247
        L4D. |    .7074878    .4284787      1.65    0.107     -.1615073     1.576483
             |
       ln_se |
         LD. |    .6462859    .2982597      2.17    0.037      .0413872     1.251185
        L2D. |    .1420399    .2307202      0.62    0.542     -.3258823      .609962
        L3D. |    .3932306    .2305856      1.71    0.097     -.0744186     .8608798
        L4D. |    .0388579    .2443514      0.16    0.875     -.4567097     .5344254
             |
       ln_me |
         LD. |   -1.903652    .5942154     -3.20    0.003     -3.108777    -.6985275
        L2D. |    .2178245    .5062558      0.43    0.670     -.8089099     1.244559
        L3D. |   -.2640008    .4292576     -0.62    0.542     -1.134576     .6065739
        L4D. |   -.6087006    .4256548     -1.43    0.161     -1.471968     .2545672
             |
       _cons |    .0025171    .0070279      0.36    0.722     -.0117361     .0167703
-------------+----------------------------------------------------------------

. savedresults comp eg e(), include(macros: depvar scalar: ll matrix: b V) tol(1e-7) verbose
comparing macro  e(depvar)
comparing scalar e(ll)
comparing matrix e(b)
comparing matrix e(V)

.
. log close
      name:  <unnamed>
       log:  f:\statadat\cs_egranger.smcl
  log type:  smcl
 closed on:  16 Aug 2012, 22:38:30
-------------