MathType

Tuesday, 14 June 2016

Cointegration Test: An Engle and Granger Test with Stata (Time Series)




There are several tests of cointegration. The Engle and Granger (1987) is the most fundamental test.


The Engle and Granger (1987) require 2 step method;




1)Estimate the original model.

\({{Y}_{t}}={{\beta }_{0}}+{{\beta }_{1}}{{X}_{t}}+{{u}_{t}}\)                                                            (1)

2)Obtain the residual from Eq(1)

\({{\hat{u}}_{t}}={{Y}_{t}}-{{\hat{\beta }}_{0}}+{{\hat{\beta }}_{1}}{{X}_{t}}\)                                                            (2)

and then test the unit root by DF method ;

    \(\Delta {{\hat{u}}_{t}}={{a}_{1}}{{\hat{u}}_{t-1}}+{{\varepsilon }_{t}}\)                                                                (3)




We use the data x and y.


Plot the series;







Perform the unit root test (ADF test or PP test )for variables x and y to make sure that all the variables is in I(1) condition.



varsoc y
dfuller y,trend lags(#)    // # = no. of lags from varsoc  //
gen yD = D.y
varsoc yD
twoway(line yD year)
dfuller yD,lags(#)




varsoc x
dfuller x,trend lags(#)    // # = no. of lags from varsoc  //
gen xD = D.x
varsoc xD
twoway(line xD year)
dfuller xD,lags(#)



The results show that both variables x and y is non-stationary in level form but stationary in first difference form, or I(1).


Estimate the model in Eq(1).


reg y x




Obtain the residual as in Eq(2)



predict uhat,residual



And then, perform the unit root test as in Eq(3)


dfuller uhat,nocons


 


Because we use the command dfuller , the critical value give by the dfuller by Stata cannot be use because is not follow the distribution for the error terms. 

We should use the critical value tabulated by Engle and Granger for the error term.

But, luckily the Stata provide the command egranger to perform Engle and Granger test directly and also provide appropriate critical value for the error term.

To perform cointegration test for variable y and x by egranger command
egranger y x,reg



 



The results shows that the error term for model Eq(1) is stationary at 5% significance level.


That means, the variables x and y is cointegrated or there are long-run equilibrium between x and y





No comments:

Post a Comment