* * Cointegration test from page 340 * open data usa.dat calendar(q) 1985 data(format=free,org=columns) 1985:01 2005:01 gdp inf f b * linreg b # constant f set e = %resids * * Auxiliary test regression * set de = e-e{1} linreg de # e{1} de{1} * * The procedure for doing this test is EGTESTRESIDS. EG stands for Engle-Granger. * This test for cointegration is known as the Engle-Granger test. You could also * use the DFUNIT procedure, but it would report the incorrect critical values. * EGTESTRESIDS gives the same test statistic as DFUNIT would, but gives the proper * critical values for the cointegration test. * @egtestresids(lags=1) e * * The EGTEST procedure does the whole cointegration test from the beginning, * including running the initial least squares regression. * @egtest(lags=1) # b f