Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions This handout illustrates the steps to carry out Unit Root tests, Johansen cointegration test, Granger Causality, variance decomposition and Impulse response functions. This example analyzes the importance of the monetary policy and its transmission mechanism in the fast-growing Malaysian economy. The monetary model is: M3 = f(Y, R, P) (1) where M3 is money supply; Y is industrial production index; R is 3-month Treasury Bill (Interest Rate); and P is Consumer Price Index (CPI). The data file is MacroM3.xls; where the dataset is covering from 1980M1 to 2008:M12. Year 1980M1 1980M2 1980M3 1980M4 1980M5 1980M6 1980M7 1980M8 1980M9 1980M10 1980M11 1980M12 1981M1 : : : M3 26281.8 27301 27926 28721.9 29483 30130 30747.6 31157.6 30864 31272.7 31906.4 32687.6 34458.1 : : : 2008M9 2008M10 2008M11 2008M12 912780 900443 909231 931656 R P 3.49 3.59 3.66 3.75 4.1 4.17 4.14 4.14 4.26 4.33 4.47 4.46 4.42 : : : 3.56 3.55 3.38 3.02 46.1 46.21 46.28 46.13 46.49 46.86 47.36 47.78 47.62 47.89 48.54 48.94 49.78 Y 12.54 12.61 13.22 13.56 13.72 12.93 14.06 13.29 13.95 13.83 13.56 13.39 13.06 : : : : : : 114.73 114.23 112.93 111.83 105.04 104.35 100.38 95.92 1 Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions 1. Open Eview 6 – File – New -- Workfile 2. Choose the frequency as Monthly – from 1980 M1 to 2008 M12 and then Click “OK” 3. Click the button “Quick” and “Empty Group (Edit Series)” 2 Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions 4. Place your cursor to the left of the first row (obs) 5. Copy the original data from Excel file. 3 Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions 6. Paste the data to Eview worksheet 7. Transform the variables into logarithm from [Type the following generate (genr) command]: genr lm3 = log(m3) genr lp = log(p) genr lr = log(r) genr ly = log(y) 4 Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions STEP 1: Unit Root Tests 8. Checking for Unit Root – For example: lm3. Double click on “lm3”, click “View” and choose the Unit Root Test. 9. We can choose Augmented Dickey Fuller (ADF) test and the optimal lag length is selected by Akaike Information Criteria (large sample size). i) First, we perform the unit root test of “lm3”: level model with constant but without trend model (let say the maximum lag is 16) . 5 Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions ii) Second, we perform the Unit root test again for the level model but now with constant with trend model. Eview Output for level Unit Root Test: Constant without Trend Model: Null Hypothesis: LM3 has a unit root Exogenous: Constant Lag Length: 16 (Automatic based on AIC, MAXLAG=16) Augmented Dickey-Fuller test statistic Test critical values: 1% level 5% level 10% level t-Statistic Prob.* -1.166712 -3.449917 -2.870057 -2.571377 0.6897 t-Statistic Prob.* -1.559270 -3.985941 -3.423418 -3.134664 0.8069 *MacKinnon (1996) one-sided p-values. Constant with Trend Model: Null Hypothesis: LM3 has a unit root Exogenous: Constant, Linear Trend Lag Length: 15 (Automatic based on AIC, MAXLAG=16) Augmented Dickey-Fuller test statistic Test critical values: 1% level 5% level 10% level *MacKinnon (1996) one-sided p-values. 6 Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions After that, we estimate the first difference with and without trend models (repeat the same process but now select 1st difference). Eview Output for First Different Unit Root Test: Constant without Trend Model: Null Hypothesis: D(LM3) has a unit root Exogenous: Constant Lag Length: 14 (Automatic based on AIC, MAXLAG=16) t-Statistic Prob.* Augmented Dickey-Fuller test statistic -2.865942 0.0505 Test critical values: -3.449857 -2.870031 -2.571363 1% level 5% level 10% level *MacKinnon (1996) one-sided p-values. Constant with Trend Model: Null Hypothesis: D(LM3) has a unit root Exogenous: Constant, Linear Trend Lag Length: 15 (Automatic based on AIC, MAXLAG=16) Augmented Dickey-Fuller test statistic Test critical values: 1% level 5% level 10% level *MacKinnon (1996) one-sided p-values. 7 t-Statistic Prob.* -3.051348 -3.986026 -3.423459 -3.134688 0.1200 Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions 10. We also can perform another unit root test namely Phillips-Perron (PP) test. Eviews Output: i. Level, Constant Without Trend Null Hypothesis: LM3 has a unit root Exogenous: Constant Bandwidth: 9 (Newey-West using Bartlett kernel) Phillips-Perron test statistic Test critical values: 1% level 5% level 10% level Adj. t-Stat Prob.* -2.469495 -3.448998 -2.869653 -2.571161 0.1239 Adj. t-Stat Prob.* -1.041872 0.9355 *MacKinnon (1996) one-sided p-values. ii. Level, Constant With Trend Null Hypothesis: LM3 has a unit root Exogenous: Constant, Linear Trend Bandwidth: 9 (Newey-West using Bartlett kernel) Phillips-Perron test statistic Test critical values: 1% level 5% level 10% level -3.984726 -3.422828 -3.134315 *MacKinnon (1996) one-sided p-values. iii. First Difference, Constant Without Trend Null Hypothesis: D(LM3) has a unit root Exogenous: Constant Bandwidth: 9 (Newey-West using Bartlett kernel) Phillips-Perron test statistic Test critical values: 1% level 5% level 10% level Adj. t-Stat Prob.* -16.62462 0.0000 -3.449053 -2.869677 -2.571174 *MacKinnon (1996) one-sided p-values. 8 Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions iv. First Difference, Constant With Trend Null Hypothesis: D(LM3) has a unit root Exogenous: Constant, Linear Trend Bandwidth: 8 (Newey-West using Bartlett kernel) Phillips-Perron test statistic Test critical values: 1% level 5% level 10% level Adj. t-Stat Prob.* -16.73624 -3.984804 -3.422865 -3.134337 0.0000 *MacKinnon (1996) one-sided p-values. Table 1 below presents the results of Unit Root Tests: Variable LM3 Table 1 Unit Root Tests Augmented Dickey Fuller Phillips Perron (ADF) (PP) Level Constant Constant Constant Constant Without Trend With Trend Without Trend With Trend -1.1667 -1.5593 -2.4695 -1.0419 (16) (15) [9] [9] LP LR LY LM3 -2.866** (14) First Difference -3.0513 -16.6246*** (15) [9] -16.7362*** [8] LP LR LY Note: *** and ** denotes significant at 1%, and 5% significance level, respectively. The figure in parenthesis (…) represents optimum lag length selected based on Akaike Info Critirion. The figure in bracket […] represents the Bandwidth used in the KPSS test selected based on Newey-West Bandwidth critirion. Please complete the above results of Unit Root Tests 9 Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions STEP 2: Estimate the Multivariate VECM Model 11. After testing the variables are stationary at first order or I(1), then the step is to estimate the Vector Error-correction Model (VECM). Firstly, we need to select an optimum lag of VECM model before performing the Johansen cointegration test. (You should show all the four log variables). Then click “Quick” – “Estimate VAR” – “Vector Error Correction” 10 Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions 12. From equation (1), the VECM model can be written as: (2) (3) (4) (5) 11 Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions STEP 2.1: Select the Optimum Lag Length (a) First, we estimate the VECM model with lag 1 Type in all variables with lm3 first (dependent variable) LM3 LY LR LP Change 2 to 1 (b) Make residuals for the VECM models, click “Proc” – “Make Residuals” EViews will show 4 residuals in the EViews Workfile – resid01 (residual in Equation 1), resid02 (residual in Equation 2), resid03 (residual in Equation 3), and resid04 (residual in Equation 4). 12 Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions (c) Now, the autocorrelation of the error terms in each regression is checked by using the Ljung-Box Q-statistic. We double click the “resid01” – “View” – “Correlogram…” – “OK” 13 Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions EViews Output: The p-value is less than 0.05. This implies that the regression residuals have autocorrelation problem. The Q-statistic shows that the error terms are statistically significant from lag 12 for “resid01”. This indicates that the model with lag 1 has autocorrelation problem. Hence, we need to re-estimate the VECM model by increasing one lag (repeat the same process but now with lag 2). This process will continue until each of the regression error terms is free from autocorrelation problem (where the p-values of Q-statistic are greater than 0.05). In this case, we repeat the same process and the optimum lag is 12. 14 Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions 13. The EViews output with 12 lag is as follows: Long-run Equation Error correction terms (ECT) STEP 2.2: Johansen Cointegration Test 14. After obtaining the optimum lag, the next step is to estimate the Johansen Cointegration Test. Click “View” – “Cointegration Test” – “OK”. 15 Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions 0.05 represent 5% significance level. EViews Output: Sample (adjusted): 1981M02 2008M12 Included observations: 335 after adjustments Trend assumption: Linear deterministic trend Series: LM3 LP LR LY Lags interval (in first differences): 1 to 12 Unrestricted Cointegration Rank Test (Trace) Hypothesized No. of CE(s) Eigenvalue Trace Statistic 0.05 Critical Value Prob.** None * At most 1 At most 2 At most 3 0.088734 0.043366 0.014884 0.002934 51.98841 20.86000 6.007864 0.984286 47.85613 29.79707 15.49471 3.841466 0.0194 0.3664 0.6946 0.3211 Trace test indicates 1 cointegrating eqn(s) at the 0.05 level * denotes rejection of the hypothesis at the 0.05 level **MacKinnon-Haug-Michelis (1999) p-values Unrestricted Cointegration Rank Test (Maximum Eigenvalue) Hypothesized No. of CE(s) Eigenvalue Max-Eigen Statistic 0.05 Critical Value Prob.** None * At most 1 At most 2 At most 3 0.088734 0.043366 0.014884 0.002934 31.12841 14.85214 5.023578 0.984286 27.58434 21.13162 14.26460 3.841466 0.0168 0.2994 0.7388 0.3211 16 Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions Max-eigenvalue test indicates 1 cointegrating eqn(s) at the 0.05 level * denotes rejection of the hypothesis at the 0.05 level **MacKinnon-Haug-Michelis (1999) p-values Table 2 presents the Johansen-Juselius Cointegration test. The result shows that both Trace test and Max-Eigen test are statistically significant to reject the null hypothesis of r = 0 at 5% significance level. Therefore, only one long run cointegration relationship between M3 and it determinants. Table 2: Johansen-Juselius Cointegration Tests Hypothesized Trace Max-Eigen Critical Values (5%) No. of CE(s) Statistic Statistic Trace Max-Eigen r=0 r≤1 r≤2 r≤3 51.9884** 20.860 6.0078 0.9843 31.1284** 14.852 5.0235 0.9843 47.856 29.797 15.495 3.8415 27.584 21.132 14.265 3.8415 Note: ** denotes significant at 5% significance levels. STEP 2.3: VECM Model If the model contains cointegration relationship among the variables, then we can proceed to VECM and the long run equation is: LM3t-1 = - 5.0146 + 3.6031 LPt-1 + 0.2233 LRt-1+ 0.3357 LYt-1 s.e (0.2872) (0.0494) (0.0946) t-stat [12.5459] [4.5212] [3.5477] All variables are positively significant at 5% significance level. 17 You can write this equation by referring to page 15 (but the coefficient signs are now reversed, why?) Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions STEP 2.4: Granger causality test 15. After estimating the long-run VECM model, then we proceed to the short run Granger causality test. Click “View” – “Lag Structure” – “Granger Causality/Block Exogeneity Tests”. EViews Output: VEC Granger Causality/Block Exogeneity Wald Tests Sample: 1980M01 2008M12 Included observations: 335 Dependent variable: D(LM3) Excluded Chi-sq df Prob. D(LP) D(LR) D(LY) 30.22932 14.72288 21.50639 12 12 12 0.0026 0.2569 0.0434 All 67.21100 36 0.0012 18 Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions Dependent variable: D(LP) Excluded Chi-sq df Prob. D(LM3) D(LR) D(LY) 23.98443 23.39792 23.92561 12 12 12 0.0204 0.0245 0.0208 All 63.26058 36 0.0033 Dependent variable: D(LR) Excluded Chi-sq df Prob. D(LM3) D(LP) D(LY) 15.82326 12.32216 13.98317 12 12 12 0.1995 0.4202 0.3018 All 36.82666 36 0.4305 Dependent variable: D(LY) Excluded Chi-sq df Prob. D(LM3) D(LP) D(LR) 17.93616 16.41443 10.79759 12 12 12 0.1176 0.1730 0.5463 All 48.57377 36 0.0786 With Cointegration, the dynamic causal interactions among the variables should be phrased in a vector error correction form. This allows us to assess both long-run and short-run causality, respectively, on the 2 -test of the lagged first differenced terms for each right-hand-side variable and the t-test of the error correction term. The results of the test are presented in Table 3. 19 Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions Table 3: Granger Causality Results based on VECM Independent Variables 2 -statistics of lagged 1st differenced term Dependent Variable ΔLM3 ΔLM3 -- ΔLP ΔLR ΔLY ECTt-1 coefficient [p-value] ΔLP ΔLR 30.23*** 14.72 [0.003] [0.257] ΔLY 21.51** [0.043] (t-ratio) -0.028** (-3.533) 23.98** [0.020] -- 23.39** [0.024] 23.93** [0.021] 0.009** (2.800) 15.82 [0.199] 12.32 [0.420] -- 13.98 [0.302] 0.124 (1.947) 17.93 [0.118] 16.41 [0.173] 10.79 [0.546] -- 0.093 (2.052) Note: *** and ** denotes significant at 1% and 5% significance level, respectively. The figure in the parenthesis (…) denote as t-statistic and the figure in the squared brackets […] represent as p-value. and the causal channels can be summarized as below: LM3 LP LY LR 20 Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions STEP 2.5: Variance decomposition (VDC) 16. The result of VECM indicates the exogeneity or endogeneity of a variable in the system and the direction of Granger-causality within the sample period. However, it does not provide us with the dynamic properties of the system. The analysis of the dynamic interactions among the variables in the post-sample period is conducted through variance decompositions (VDCs) and impulse response functions (IRFs). Click “View” – “Variance Decompositions” – “Table” EViews Output: Variance Decomposition of LM3: Period S.E. LM3 LP LR LY 1 2 3 4 5 6 7 8 9 10 0.009207 0.012581 0.015458 0.018050 0.020777 0.023737 0.026313 0.028367 0.030475 0.032785 100.0000 99.59571 99.50123 98.21271 94.57704 91.01041 88.11711 84.90036 81.38129 76.88578 0.000000 0.237534 0.242707 0.478537 1.376087 2.386103 2.976382 3.376980 2.986563 2.630474 0.000000 7.15E-06 0.022763 0.134646 1.117796 1.674290 2.326990 2.783734 3.496885 4.784743 0.000000 0.166753 0.233302 1.174103 2.929073 4.929200 6.579520 8.938924 12.13526 15.69901 Variance Decomposition of LP: Period S.E. LM3 LP LR LY 21 Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions 1 2 3 4 5 6 7 8 9 10 0.003904 0.006102 0.007787 0.009032 0.010067 0.010816 0.011544 0.012314 0.012968 0.013545 0.057833 0.232518 0.493569 0.723986 1.013711 2.379293 4.710690 6.518148 7.566270 8.302143 99.94217 99.30812 99.04644 98.88313 98.49578 96.86372 94.19444 91.82371 90.49069 89.10389 0.000000 0.034317 0.076551 0.067843 0.206479 0.504991 0.867165 1.438480 1.743578 2.390148 0.000000 0.425045 0.383441 0.325045 0.284028 0.251992 0.227708 0.219661 0.199466 0.203815 Variance Decomposition of LR: Period S.E. LM3 LP LR LY 1 2 3 4 5 6 7 8 9 10 0.072920 0.111546 0.139640 0.161746 0.176165 0.191569 0.208351 0.222819 0.236249 0.251486 2.995915 3.619142 4.349874 4.672351 5.039088 5.355593 4.742339 4.361189 3.960742 3.503003 0.019765 0.098381 0.076814 0.223168 0.224267 0.193439 0.306652 0.434910 0.732402 0.914070 96.98432 96.28206 95.55480 95.05622 94.69537 94.34811 94.75085 94.95968 94.78659 94.85731 0.000000 0.000418 0.018517 0.048258 0.041277 0.102858 0.200158 0.244217 0.520266 0.725617 Variance Decomposition of LY: Period S.E. LM3 LP LR LY 1 2 3 4 5 6 7 8 9 10 0.051559 0.060572 0.072073 0.082283 0.089036 0.094439 0.098761 0.104042 0.108643 0.112538 0.724280 0.608491 0.473792 1.219285 1.136213 1.235009 1.619555 2.296307 2.798176 3.291952 0.570742 0.768220 1.096219 1.277598 1.872747 1.895860 2.445372 4.431683 4.585921 5.643364 0.577937 0.439926 0.640465 0.572537 0.548866 0.577269 0.530370 0.639905 1.005189 1.336476 98.12704 98.18336 97.78952 96.93058 96.44217 96.29186 95.40470 92.63211 91.61071 89.72821 Cholesky Ordering: LM3 LP LR LY 22 Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions STEP 2.6: Impulse response functions (IRFs) 17. Estimate the impulse response functions (IRFs), click “Estimate” and change the “Vector Error Correction” to “Unrestricted VAR” and increase one more lag for the model from lag 12 to lag 13. Select “Impulse” 23 Unit Root, Cointegration, VECM, Variance Decomposition and Impulse Response Functions Response to Cholesky One S.D. Innovations ± 2 S.E. Response of LM3 to LM3 Response of LM3 to LP Response of LM3 to LR Response of LM3 to LY .015 .015 .015 .015 .010 .010 .010 .010 .005 .005 .005 .005 .000 .000 .000 .000 -.005 -.005 -.005 -.005 -.010 -.010 1 2 3 4 5 6 7 8 9 -.010 1 10 2 Response of LP to LM3 3 4 5 6 7 8 9 -.010 1 10 2 Response of LP to LP 3 4 5 6 7 8 9 1 10 .006 .006 .006 .004 .004 .004 .004 .002 .002 .002 .002 .000 .000 .000 .000 -.002 1 2 3 4 5 6 7 8 9 -.002 1 10 2 Response of LR to LM3 3 4 5 6 7 8 9 2 Response of LR to LP 3 4 5 6 7 8 9 1 10 .12 .12 .08 .08 .08 .08 .04 .04 .04 .04 .00 .00 .00 .00 -.04 2 3 4 5 6 7 8 9 -.04 1 10 2 Response of LY to LM3 3 4 5 6 7 8 9 2 Response of LY to LP 3 4 5 6 7 8 9 1 10 .06 .06 .06 .04 .04 .04 .02 .02 .02 .02 .00 .00 .00 .00 -.02 -.02 -.02 -.02 -.04 2 3 4 5 6 7 8 9 10 -.04 1 2 3 4 5 6 7 8 9 10 24 7 8 9 10 3 4 5 6 7 8 9 10 3 4 5 6 7 8 9 10 9 10 Response of LY to LY .04 1 2 Response of LY to LR .06 -.04 6 -.04 1 10 5 Response of LR to LY .12 1 2 Response of LR to LR .12 -.04 4 -.002 1 10 3 Response of LP to LY .006 -.002 2 Response of LP to LR -.04 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8