Page 1 of 1

EGTEST - Engle-Granger test for cointegration

PostPosted: Sun Jul 22, 2012 10:27 am
by moderator
Attached is a revised version of the @EGTEST procedure for doing the Engle-Granger residual-based cointegration test. This includes options for automatic lag length selection, with options similar to the ones that we've used in other procedures. The default for the new METHOD option is METHOD=INPUT, so it will work without change for existing programs. @EGTEST uses @EGTESTRESIDS (http://www.estima.com/forum/viewtopic.php?f=7&t=1258) for the actual test on the residuals----it runs the preliminary regression and passes the residuals and options on to @EGTESTRESIDS for the final calculations.

egtest.src
Procedure file - requires RATS 7.3 or later
(3.27 KiB) Downloaded 95 times


@EGTEST( options ) start end
# list of endogenous variables (the first variable listed is used as the dependent variable)

Options for Selecting Lags

LAGS=number of additional lags [0]
MAXLAGS=maximum number of additional lags to consider [number of observations^.25]
You can use either of these to select either the (maximum) number of additional lags. If you don't use either option, the LAGS default of 0 will be used for METHOD=INPUT and the MAXLAGS default will be used for the others.

METHOD=[INPUT]/AIC/BIC/HQ/TTEST/GTOS
METHOD=INPUT uses the input number of LAGS only. METHOD=AIC/BIC/HQ tests the D-F regressions for everything from 0 to LAGS/MAXLAGS and chooses the minimizer for the chosen criterion. METHOD=TTEST/GTOS starts with the full set of lags and deletes lags as long as the final one has a marginal significance level less than the cutoff given by the SIGNIF option. (GTOS is short for General-TO-Specific).

SIGNIF=cutoff significance level for METHOD=TTEST or GTOS[.10]

Other Options

DET=NONE/[CONSTANT]/TREND
Choose what deterministic components were included in the original regression. This changes the critical values.

[PRINT]/NOPRINT
TITLE=Title for output ["Engle-Granger Cointegration Test"]

Example

Code: Select all
*
* Pindyck & Rubinfeld, Econometric Models and Economic Forecasts, 4th edition
* Example 16.5 from page 515
*
open data ex165.xls
calendar(q) 1960:1
data(format=xls,org=columns) 1960:1 1995:4 gcq gydq
*
* We first have to check that the series involved have a unit root. This
* checks that with a variety of choices for the number of lags.
*
@dfunit(lags=1) gcq
@dfunit(lags=2) gcq
@dfunit(lags=4) gcq
@dfunit(lags=1) gydq
@dfunit(lags=2) gydq
@dfunit(lags=4) gydq
*
linreg gcq
# constant gydq
*
* The Engle-Granger test for cointegration involves running a
* Dickey-Fuller test on the residuals from the co-integrating
* regression. However, the critical values are different. In order to
* get the correct critical values, use the EGTEST procedure. On this,
* you list all the endogenous variables (there could be more than two in
* some applications) on the supplementary card. RATS normalizes the
* cointegrating regression by using the first of these as the dependent
* variable. You'll notice that this produces (as the first step) exactly
* the same regression as above.
*
@egtest
# gcq gydq


ex165.xls
Data file for example
(11.23 KiB) Downloaded 48 times