1

I have used EViews and run Error Correction Model (ECM) and obtained some result. Now I would like to replicate that example in R and obtain the same result like I did in EViews.

The data I have used are as follows:

    gdp<-c(6592.694,7311.75,7756.11,8374.175,9169.984,9994.071,10887.682,11579.432,12440.625,13582.799,15261.26,17728.673,21899.262,29300.921,34933.51,39768.017,42647.701,51144.915,61554.743,73407.498,81467.464,70500.215,70682.449,71496.768,67403.443,68781.085,98203.625,123083.47,131969.428,131738.237,164753.092,172008.565,193073.835,188423.703,201444.061,238561.784,234676.457,207826.099,213329.585,212301.777,192070.75,191678.678,207537.337,253945.777,291430.382,304983.602,324954.402,375041.784,414173.646,381775.165,376575.382)
    life<-c(68.58560976,69.57731707,69.3095122,69.44365854,69.92195122,69.72219512,70.04585366,69.91780488,70.05756098,69.83317073,69.89073171,70.06926829,70.41365854,70.97926829,70.96243902,71.08414634,71.55121951,71.89536585,71.96707317,72.28731707,72.42365854,72.75804878,72.89707317,72.96853659,73.52756098,73.74512195,74.22292683,74.66926829,75.14414634,75.24804878,75.53,75.56780488,75.85536585,76.10634146,76.45707317,76.71560976,76.98365854,77.38756098,77.57317073,77.77560976,78.02682927,78.52682927,78.67804878,78.63170732,79.1804878,79.33170732,79.83170732,79.98292683,80.23414634,80.08292683,80.38292683)

The result I obtained in EViews and would like to replicate in R is shown in the following table: enter image description here

I used package apt and its function ecmAsyFit(gdp, life, lag = 1, split = TRUE,model = "linear", thresh = 0) The code I have run is as follows:

df <- ts(cbind(gdp, life), start = 1950, freq = 1)
fit <-   ecmAsyFit(df[, 1], df[, 2], lag = 1, split = TRUE, model = "linear", thresh = 0)
summary(fit)

The result in R I obtained is shown under:

              DepVar                 IndVar     estimate     error t.value p.value signif
1  diff.df[, 2].t_0  |            (Intercept)      0.324     0.063   5.135   0.000    ***
2                    | X.diff.df[, 2].t_1.pos     -0.458     0.155  -2.954   0.005    ***
3                    | X.diff.df[, 2].t_1.neg      0.443     0.546   0.811   0.422       
4                    | X.diff.df[, 1].t_1.pos      0.000     0.000   1.410   0.166       
5                    | X.diff.df[, 1].t_1.neg      0.000     0.000  -1.475   0.148      .
6                    |          X.ECT.t_1.pos      0.000     0.000  -1.819   0.076      *
7                    |          X.ECT.t_1.neg      0.000     0.000  -0.420   0.677       
8  diff.df[, 1].t_0  -            (Intercept)   3793.752  4912.683   0.772   0.444       
9                    - X.diff.df[, 2].t_1.pos  -4510.643 12060.505  -0.374   0.710       
10                   - X.diff.df[, 2].t_1.neg -21884.942 42483.319  -0.515   0.609       
11                   - X.diff.df[, 1].t_1.pos      0.576     0.190   3.031   0.004    ***
12                   - X.diff.df[, 1].t_1.neg      0.055     0.369   0.148   0.883       
13                   -          X.ECT.t_1.pos     -0.318     0.145  -2.193   0.034     **
14                   -          X.ECT.t_1.neg     -0.175     0.130  -1.354   0.183       

Problem: The result I obtained in EViews (shown table) is not the same like it is R (shown right above)

Questions:

  1. Is there a way to use ecmAsyFit function to obtain result like it is shown in the table?
  2. Is there another function (or set of functions) which can run Error Correction Model and provide the result shown in the table?
  3. Could someone share the code for application of Error Correction Model, so I could apply it?
4

1 に答える 1