@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
