You are on page 1of 24

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 M3 R P Y
1980M1 26281.8 3.49 46.1 12.54
1980M2 27301 3.59 46.21 12.61
1980M3 27926 3.66 46.28 13.22
1980M4 28721.9 3.75 46.13 13.56
1980M5 29483 4.1 46.49 13.72
1980M6 30130 4.17 46.86 12.93
1980M7 30747.6 4.14 47.36 14.06
1980M8 31157.6 4.14 47.78 13.29
1980M9 30864 4.26 47.62 13.95
1980M10 31272.7 4.33 47.89 13.83
1980M11 31906.4 4.47 48.54 13.56
1980M12 32687.6 4.46 48.94 13.39
1981M1 34458.1 4.42 49.78 13.06
: : : : :
: : : : :
: : : : :
2008M9 912780 3.56 114.73 105.04
2008M10 900443 3.55 114.23 104.35
2008M11 909231 3.38 112.93 100.38
2008M12 931656 3.02 111.83 95.92

1
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
4. Place your cursor to the left of the first row (obs)

5. Copy the original data from Excel file.

6. Paste the data to Eview worksheet

3
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)

STEP 1: Unit Root Tests

4
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) .

ii) Second, we perform the Unit root test again for the level model but now with
constant with trend model.
5
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)

t-Statistic Prob.*

Augmented Dickey-Fuller test statistic -1.166712 0.6897


Test critical values: 1% level -3.449917
5% level -2.870057
10% level -2.571377

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

t-Statistic Prob.*

Augmented Dickey-Fuller test statistic -1.559270 0.8069


Test critical values: 1% level -3.985941
5% level -3.423418
10% level -3.134664

*MacKinnon (1996) one-sided p-values.


After that, we estimate the first difference with and without trend models (repeat the same
process but now select 1st difference).

6
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: 1% level -3.449857
5% level -2.870031
10% level -2.571363

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

t-Statistic Prob.*

Augmented Dickey-Fuller test statistic -3.051348 0.1200


Test critical values: 1% level -3.986026
5% level -3.423459
10% level -3.134688

*MacKinnon (1996) one-sided p-values.


10. We also can perform another unit root test namely Phillips-Perron (PP) test.

7
Eviews Output:

i. Level, Constant Without Trend

Null Hypothesis: LM3 has a unit root


Exogenous: Constant
Bandwidth: 9 (Newey-West using Bartlett kernel)

Adj. t-Stat Prob.*

Phillips-Perron test statistic -2.469495 0.1239


Test critical values: 1% level -3.448998
5% level -2.869653
10% level -2.571161

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

Adj. t-Stat Prob.*

Phillips-Perron test statistic -1.041872 0.9355


Test critical values: 1% level -3.984726
5% level -3.422828
10% level -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)

Adj. t-Stat Prob.*

Phillips-Perron test statistic -16.62462 0.0000


Test critical values: 1% level -3.449053
5% level -2.869677
10% level -2.571174

*MacKinnon (1996) one-sided p-values.


iv. First Difference, Constant With Trend

8
Null Hypothesis: D(LM3) has a unit root
Exogenous: Constant, Linear Trend
Bandwidth: 8 (Newey-West using Bartlett kernel)

Adj. t-Stat Prob.*

Phillips-Perron test statistic -16.73624 0.0000


Test critical values: 1% level -3.984804
5% level -3.422865
10% level -3.134337

*MacKinnon (1996) one-sided p-values.

Table 1 below presents the results of Unit Root Tests:

Table 1 Unit Root Tests


Augmented Dickey Fuller Phillips Perron
(ADF) (PP)
Level
Variable Constant Constant Constant Constant
Without Trend With Trend Without Trend With Trend
LM3 -1.1667 -1.5593 -2.4695 -1.0419
(16) (15) [9] [9]
LP

LR

LY

First Difference
LM3 -2.866** -3.0513 -16.6246*** -16.7362***
(14) (15) [9] [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


STEP 2: Estimate the Multivariate VECM Model

9
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
12. From equation (1), the VECM model can be written as:

𝑗
∆𝐿𝑀31𝑡 = 𝜇1𝑡 − ∅1 (𝐿𝑀3 − 𝛾0 − 𝛾1 𝐿𝑌 − 𝛾2 𝐿𝑅 − 𝛾3 𝐿𝑃)𝑡−1 + ∑𝑖=1 𝛽1,𝑗 ∆𝐿𝑀31𝑡−𝑖 +
∑𝑗𝑖=1 𝛽2,𝑗 ∆𝐿𝑌1𝑡−𝑖 + ∑𝑗𝑖=1 𝛽3,𝑗 ∆𝐿𝑅1𝑡−𝑖 + ∑𝑗𝑖=1 ∆𝐿𝑃1𝑡−𝑖 + 𝜀1𝑡
(2)

𝑗
∆𝐿𝑌2𝑡 = 𝜇2𝑡 − ∅2 (𝐿𝑀3 − 𝛾0 − 𝛾1 𝐿𝑌 − 𝛾2 𝐿𝑅 − 𝛾3 𝐿𝑃)𝑡−1 + ∑𝑖=1 ∆𝐿𝑀32𝑡−𝑖 +
∑𝑗𝑖=1 ∆𝐿𝑌2𝑡−𝑖 + ∑𝑗𝑖=1 ∆𝐿𝑅2𝑡−𝑖 + ∑𝑗𝑖=1 ∆𝐿𝑃2𝑡−𝑖 + 𝜀2𝑡
(3)

𝑗
∆𝐿𝑅3𝑡 = 𝜇3𝑡 − ∅3 (𝐿𝑀3 − 𝛾0 − 𝛾1 𝐿𝑌 − 𝛾2 𝐿𝑅 − 𝛾3 𝐿𝑃)𝑡−1 + ∑𝑖=1 ∆𝐿𝑀33𝑡−𝑖 +
∑𝑗𝑖=1 ∆𝐿𝑌3𝑡−𝑖 + ∑𝑗𝑖=1 ∆𝐿𝑅3𝑡−𝑖 + ∑𝑗𝑖=1 ∆𝐿𝑃3𝑡−𝑖 + 𝜀3𝑡
(4)

𝑗
∆𝐿𝑃4𝑡 = 𝜇4𝑡 − ∅4 (𝐿𝑀3 − 𝛾0 − 𝛾1 𝐿𝑌 − 𝛾2 𝐿𝑅 − 𝛾3 𝐿𝑃)𝑡−1 + ∑𝑖=1 ∆𝐿𝑀34𝑡−𝑖 +
∑𝑗𝑖=1 ∆𝐿𝑌4𝑡−𝑖 + ∑𝑗𝑖=1 ∆𝐿𝑅4𝑡−𝑖 + ∑𝑗𝑖=1 ∆𝐿𝑃4𝑡−𝑖 + 𝜀4𝑡
(5)

11
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
(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
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
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
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 Trace 0.05


No. of CE(s) Eigenvalue Statistic Critical Value Prob.**

None * 0.088734 51.98841 47.85613 0.0194


At most 1 0.043366 20.86000 29.79707 0.3664
At most 2 0.014884 6.007864 15.49471 0.6946
At most 3 0.002934 0.984286 3.841466 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 Max-Eigen 0.05


No. of CE(s) Eigenvalue Statistic Critical Value Prob.**

None * 0.088734 31.12841 27.58434 0.0168


At most 1 0.043366 14.85214 21.13162 0.2994
At most 2 0.014884 5.023578 14.26460 0.7388
At most 3 0.002934 0.984286 3.841466 0.3211

16
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 51.9884** 31.1284** 47.856 27.584


r≤1 20.860 14.852 29.797 21.132
r≤2 6.0078 5.0235 15.495 14.265
r≤3 0.9843 0.9843 3.8415 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] You can write this
equation by referring to
All variables are positively significant at 5% significance level. page 15 (but the
coefficient signs are now
reversed, why?)

17
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) 30.22932 12 0.0026


D(LR) 14.72288 12 0.2569
D(LY) 21.50639 12 0.0434

All 67.21100 36 0.0012

18
Dependent variable: D(LP)

Excluded Chi-sq df Prob.

D(LM3) 23.98443 12 0.0204


D(LR) 23.39792 12 0.0245
D(LY) 23.92561 12 0.0208

All 63.26058 36 0.0033

Dependent variable: D(LR)

Excluded Chi-sq df Prob.

D(LM3) 15.82326 12 0.1995


D(LP) 12.32216 12 0.4202
D(LY) 13.98317 12 0.3018

All 36.82666 36 0.4305

Dependent variable: D(LY)

Excluded Chi-sq df Prob.

D(LM3) 17.93616 12 0.1176


D(LP) 16.41443 12 0.1730
D(LR) 10.79759 12 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
Table 3: Granger Causality Results based on VECM
Independent Variables
Dependent  2 -statistics of lagged 1st differenced term ECTt-1
coefficient
[p-value]
Variable ΔLM3 ΔLP ΔLR ΔLY (t-ratio)
ΔLM3 30.23*** 14.72 21.51** -0.028**
-- [0.003] [0.257] [0.043] (-3.533)

ΔLP 23.98** 23.39** 23.93** 0.009**


[0.020] -- [0.024] [0.021] (2.800)

ΔLR 15.82 12.32 13.98 0.124


[0.199] [0.420] -- [0.302] (1.947)

ΔLY 17.93 16.41 10.79 0.093


[0.118] [0.173] [0.546] -- (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
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 0.009207 100.0000 0.000000 0.000000 0.000000


2 0.012581 99.59571 0.237534 7.15E-06 0.166753
3 0.015458 99.50123 0.242707 0.022763 0.233302
4 0.018050 98.21271 0.478537 0.134646 1.174103
5 0.020777 94.57704 1.376087 1.117796 2.929073
6 0.023737 91.01041 2.386103 1.674290 4.929200
7 0.026313 88.11711 2.976382 2.326990 6.579520
8 0.028367 84.90036 3.376980 2.783734 8.938924
9 0.030475 81.38129 2.986563 3.496885 12.13526
10 0.032785 76.88578 2.630474 4.784743 15.69901

Variance Decomposition of LP:


Period S.E. LM3 LP LR LY

21
1 0.003904 0.057833 99.94217 0.000000 0.000000
2 0.006102 0.232518 99.30812 0.034317 0.425045
3 0.007787 0.493569 99.04644 0.076551 0.383441
4 0.009032 0.723986 98.88313 0.067843 0.325045
5 0.010067 1.013711 98.49578 0.206479 0.284028
6 0.010816 2.379293 96.86372 0.504991 0.251992
7 0.011544 4.710690 94.19444 0.867165 0.227708
8 0.012314 6.518148 91.82371 1.438480 0.219661
9 0.012968 7.566270 90.49069 1.743578 0.199466
10 0.013545 8.302143 89.10389 2.390148 0.203815

Variance Decomposition of LR:


Period S.E. LM3 LP LR LY

1 0.072920 2.995915 0.019765 96.98432 0.000000


2 0.111546 3.619142 0.098381 96.28206 0.000418
3 0.139640 4.349874 0.076814 95.55480 0.018517
4 0.161746 4.672351 0.223168 95.05622 0.048258
5 0.176165 5.039088 0.224267 94.69537 0.041277
6 0.191569 5.355593 0.193439 94.34811 0.102858
7 0.208351 4.742339 0.306652 94.75085 0.200158
8 0.222819 4.361189 0.434910 94.95968 0.244217
9 0.236249 3.960742 0.732402 94.78659 0.520266
10 0.251486 3.503003 0.914070 94.85731 0.725617

Variance Decomposition of LY:


Period S.E. LM3 LP LR LY

1 0.051559 0.724280 0.570742 0.577937 98.12704


2 0.060572 0.608491 0.768220 0.439926 98.18336
3 0.072073 0.473792 1.096219 0.640465 97.78952
4 0.082283 1.219285 1.277598 0.572537 96.93058
5 0.089036 1.136213 1.872747 0.548866 96.44217
6 0.094439 1.235009 1.895860 0.577269 96.29186
7 0.098761 1.619555 2.445372 0.530370 95.40470
8 0.104042 2.296307 4.431683 0.639905 92.63211
9 0.108643 2.798176 4.585921 1.005189 91.61071
10 0.112538 3.291952 5.643364 1.336476 89.72821

Cholesky Ordering: LM3 LP LR


LY

22
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
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 -.010 -.010


1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10

Response of LP to LM3 Response of LP to LP Response of LP to LR Response of LP to LY


.006 .006 .006 .006

.004 .004 .004 .004

.002 .002 .002 .002

.000 .000 .000 .000

-.002 -.002 -.002 -.002


1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10

Response of LR to LM3 Response of LR to LP Response of LR to LR Response of LR to LY


.12 .12 .12 .12

.08 .08 .08 .08

.04 .04 .04 .04

.00 .00 .00 .00

-.04 -.04 -.04 -.04


1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10

Response of LY to LM3 Response of LY to LP Response of LY to LR Response of LY to LY


.06 .06 .06 .06

.04 .04 .04 .04

.02 .02 .02 .02

.00 .00 .00 .00

-.02 -.02 -.02 -.02

-.04 -.04 -.04 -.04


1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10

24

You might also like