EGTESTRESIDS Procedure |
@EGTESTRESIDS performs an Engle-Granger residual-based cointegration test taking as input the residuals from a preliminary regression. @EGTEST is similar, but takes as input the endogenous variables and runs the preliminary regression.
@EGTESTRESIDS(options) u start end
Parameters
|
u |
residuals from preliminary Engle-Granger regression (static regression of one endogenous variable on the others plus deterministics) |
|
start, end |
estimation range, by default, the range of u. |
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
NVAR=number of endogenous variables in the cointegrating regression, counting the dependent variable [2]
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"]
Variables Defined
|
%NOBS |
number of regression observations + 1 (tables are based upon this) (INTEGER) |
|
%CDSTAT |
test statistic (REAL) |
|
%NVAR |
number of variables (INTEGER) |
|
%%AUTOP |
number of lags used (INTEGER) |
Example
*
* 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
*
@egtest
# gcq gydq
Sample Output
The first part of the output is from a linear regression of the first endogenous variable on all the others plus the chosen deterministic variables. The second is the test statistic generated from the first-stage residuals.
Linear Regression - Estimation by Least Squares
Dependent Variable GCQ
Quarterly Data From 1960:01 To 1995:04
Usable Observations 144
Degrees of Freedom 142
Centered R^2 0.9973657
R-Bar^2 0.9973472
Uncentered R^2 0.9997470
Mean of Dependent Variable 2899.6409692
Std Error of Dependent Variable 948.3894538
Standard Error of Estimate 48.8474061
Sum of Squared Residuals 338821.81013
Regression F(1,142) 53762.6779
Significance Level of F 0.0000000
Log Likelihood -763.2931
Durbin-Watson Statistic 0.3254
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. GYDQ 0.93461707 0.00403082 231.86780 0.00000000
2. Constant -89.93878564 13.52077674 -6.65189 0.00000000
Engle-Granger Cointegration Test
Null is no cointegration (residual has unit root)
Regression Run From 1960:02 to 1995:04
Observations 144
Using fixed lags 0
Constant in cointegrating vector
Critical Values from MacKinnon for 2 Variables
Test Statistic -3.61347*
1%(**) -3.97470
5%(*) -3.37957
10% -3.07473
Copyright © 2026 Thomas A. Doan