Skip to content

Cointegration: The Engle-Granger Two-Step Method

When can you trust a regression between two non-stationary series? Cointegration, the Engle-Granger two-step method, the critical-value trap in residual-based unit root testing, and why spurious regression still ruins empirical work.

2 of 12 ~15 min

Start with a move that macro papers got away with for decades. Regress U.S. real GNP on money supply over a multi-decade sample. Both series trend upward the whole way. The R2R^2 comes out at 0.95, the tt-statistic on the slope is 12.4, and you write a paper claiming money supply drives output. Submit that today and it gets rejected on sight — not because the conclusion is unwelcome, but because the regression proves nothing at all.

The relationship is nonsense. Both series are trended, and any two trended series can appear highly correlated in finite samples, even when they are generated by completely independent random walks. Granger & Newbold (1974) proved it: under the null of no relationship, when both series are non-stationary, the tt-statistic does not follow the tt-distribution — it diverges to infinity. Nor does R2R^2 converge to zero; it converges to a non-degenerate distribution. This is spurious regression, and it has ruined more empirical work over the decades than any other single econometric mistake.

If you don’t believe it, run it yourself. Generate two independent random walks and regress one on the other:

import numpy as np
import statsmodels.api as sm

rng = np.random.default_rng(42)
T = 200
x = np.cumsum(rng.standard_normal(T))
y = np.cumsum(rng.standard_normal(T))

X = sm.add_constant(x)
res = sm.OLS(y, X).fit()
print(f"R²: {res.rsquared:.3f}")
print(f"Slope t-stat: {res.tvalues[1]:.3f}")
print(f"Slope p-value: {res.pvalues[1]:.4f}")

Vary the seed and rerun. Roughly 30% of the time you will see R2>0.5R^2 > 0.5 and tt-statistics in the double digits — with xx and yy completely independent. This is not a typo or a bug. It is a fundamental property of regressions with trended variables. Whenever you see a paper regress one I(1) variable on another without testing for cointegration or differencing first, that paper is probably wrong.

Does that mean regressions in levels are always forbidden? No. Engle & Granger (1987) worked out exactly when the exception holds, and the result is one of the most useful ideas in modern econometrics — and one of the most misapplied. The core insight: if two or more I(1) series share a long-run equilibrium relationship, a specific linear combination of them is I(0), even though each series is non-stationary in levels. Back to the example: if money supply and GNP are both driven by a common long-run trend (the economy grows, both grow with it), then a combination like “log money supply minus log GNP” might be stationary. That stationary combination is the cointegrating relation, and it hands you a stationary error-correction term for a dynamic model. Model it correctly and your inference is valid.

This article covers the Engle-Granger two-step method in detail, including its well-known weaknesses. The textbook treatments are Hamilton (1994, Ch. 19), Tsay (2010, Ch. 7-8), and Campbell, Lo, & MacKinlay (1997, Ch. 6); specific results are cited where they come up.

Cointegration, Formally

A set of KK time series yt=(y1t,…,yKt)′\mathbf{y}_t = (y_{1t}, \ldots, y_{Kt})' is cointegrated if both of the following hold:

  1. Each yity_{it} is I(1): non-stationary in levels and stationary in first differences.
  2. There exists a non-zero vector β=(β1,…,βK)′\boldsymbol{\beta} = (\beta_1, \ldots, \beta_K)' such that β′yt\boldsymbol{\beta}' \mathbf{y}_t is I(0), or stationary.

The vector β\boldsymbol{\beta} is the cointegrating vector; the combination β′yt\boldsymbol{\beta}' \mathbf{y}_t is the cointegrating relation. Economically it reads as a long-run equilibrium: deviations from it are stationary, so they must eventually return to zero.

A system can contain more than one such combination. If there are multiple cointegrating relations, the system has cointegration rank r>1r > 1. For KK variables the rank can be anywhere from 0 (no cointegration) to K−1K - 1; rank KK would mean every variable is stationary on its own, contradicting condition 1. Hold on to the rank concept — the deepest limitation of the Engle-Granger method is buried right there, and we will come back to it.

Step 1: Estimate the Cointegrating Vector by OLS

Run a regression of y1ty_{1t} on (y2t,…,yKt)(y_{2t}, \ldots, y_{Kt}) (or any normalization you prefer):

y1t=β1+β2y2t+⋯+βKyKt+uty_{1t} = \beta_1 + \beta_2 y_{2t} + \cdots + \beta_K y_{Kt} + u_t

Note the absence of y1ty_{1t} on the right side: one variable must be normalized (here y1ty_{1t}, as the dependent variable) with its coefficient set to 1. This is just a normalization choice; you could have put a different variable on the left — and that choice will come back to bite later, so keep it in mind. The OLS estimate β^EG\hat{\boldsymbol{\beta}}_{EG} is the cointegrating vector estimate.

The estimate has an unusual property: it is super-consistent. β^EG−β=Op(1/T)\hat{\boldsymbol{\beta}}_{EG} - \boldsymbol{\beta} = O_p(1/T), much faster than the usual Op(1/T)O_p(1/\sqrt{T}), because the OLS objective function has a non-standard limit under cointegration; Stock (1987) proved it. The intuition: the dependent and independent variables are both diverging, but the cointegrating relation ties them together, so the noise in β^\hat{\boldsymbol{\beta}} is dominated by the lower-order terms. Super-consistency is the load-bearing wall of the whole two-step construction — the estimation error from step 1 decays fast enough that step 2 can treat u^t\hat{u}_t as a stand-in for the true residuals.

Step 2: Test the Residuals for a Unit Root

Compute the OLS residuals u^t=y1t−β^1−β^2y2t−⋯−β^KyKt\hat{u}_t = y_{1t} - \hat{\beta}_1 - \hat{\beta}_2 y_{2t} - \cdots - \hat{\beta}_K y_{Kt} and run an ADF test on them:

Δu^t=ρu^t−1+∑j=1kγjΔu^t−j+et\Delta \hat{u}_t = \rho \hat{u}_{t-1} + \sum_{j=1}^k \gamma_j \Delta \hat{u}_{t-j} + e_t

The null is H0:ρ=0H_0: \rho = 0 (a unit root in the residuals, i.e. no cointegration); the alternative is ρ<0\rho < 0 (stationary residuals, i.e. cointegration). Reject no-cointegration if the ADF statistic is more negative than the critical value.

The entire method lives or dies on this step, and this step is also where it gets misused the most. The most common mistake: judging the residuals against standard ADF critical values. You can’t. u^t\hat{u}_t is not an observed series — it was estimated in step 1, and the estimation error in β^\hat{\boldsymbol{\beta}} makes the residuals look more stationary than the true errors are, so the residual-based test needs critical values that are larger in absolute value. Engle & Yoo (1987) tabulated them: with K=3K = 3 variables, the 5% critical value is approximately −3.37-3.37, versus −2.86-2.86 for standard ADF. Judge against −2.86-2.86 and you reject too often, declaring cointegration in systems that have none. MacKinnon (1996) later provided more precise critical values via response surface regressions, which is what most software implements; the general pattern is that critical values get more negative as KK grows, but the effect is modest.

Three more traps, all in the test specification. First, the number of lagged differences kk must be chosen to whiten the residuals, typically via AIC or Schwert’s rule; too few lags leaves autocorrelation in the residuals and the test is mis-sized. Second, if the variables carry deterministic trends, the cointegrating regression needs a trend term — omit it and the residuals are misspecified, so you are testing the wrong object. Third, do not treat a high R2R^2 from the step-1 regression as evidence of cointegration — the opening demonstration already showed that trended variables produce high R2R^2 with no relationship at all. The only thing that counts is the ADF on the residuals.

Note also that everything above rests on the premise that each variable is I(1). Engle-Granger does not test that premise for you; run unit root tests on each variable first. Let an I(0) variable slip in and the test is invalid.

If you reject the null — correctly — you have evidence that the variables are cointegrated with cointegrating vector approximately β^EG\hat{\boldsymbol{\beta}}_{EG}, and you can move on to modeling the dynamics.

Code: Engle-Granger in statsmodels

statsmodels packages both steps; coint uses the MacKinnon response-surface critical values directly:

import pandas as pd
import statsmodels.api as sm
from statsmodels.tsa.stattools import adfuller, coint


X = sm.add_constant(y['log_gnp'])
eg_reg = sm.OLS(y['log_money'], X).fit()
print(eg_reg.summary())

residuals = eg_reg.resid

# Engle-Granger critical values from MacKinnon response surface
eg_stat, eg_p, eg_crit = coint(y['log_money'], y['log_gnp'], trend='c', autolag='aic')[:3]
print(f"Engle-Granger test stat: {eg_stat:.3f}, p-value: {eg_p:.3f}")

# Alternative: ADF on residuals with custom critical values
adf_stat, _, _, _, adf_crit, _ = adfuller(residuals, regression='c', autolag='aic')
print(f"ADF on residuals: {adf_stat:.3f}")
print(f"Standard ADF crit values: {adf_crit}")
# Compare to Engle-Granger crit values (e.g., -3.37 for K=3 at 5%)

The manual adfuller route requires you to swap in your own critical values — what it prints are the standard ADF ones, exactly the set the previous section told you not to use. It is included here so you can see how far apart the two sets are.

After Cointegration: The Error Correction Model

With cointegration established, write the dynamics as a VECM:

Δy1t=α1u^t−1+∑j=1p−1Γ1jΔyt−j+error1t\Delta y_{1t} = \alpha_1 \hat{u}_{t-1} + \sum_{j=1}^{p-1} \Gamma_{1j} \Delta \mathbf{y}_{t-j} + \text{error}_{1t} Δy2t=α2u^t−1+∑j=1p−1Γ2jΔyt−j+error2t\Delta y_{2t} = \alpha_2 \hat{u}_{t-1} + \sum_{j=1}^{p-1} \Gamma_{2j} \Delta \mathbf{y}_{t-j} + \text{error}_{2t}

and so on. The coefficient αi\alpha_i on the lagged residual u^t−1\hat{u}_{t-1} is the adjustment speed: how much yity_{it} corrects in period tt in response to last period’s deviation from equilibrium. For a stable error-correction mechanism, the adjustment coefficient should be negative for the variable that does the correcting (the dependent variable in the cointegrating regression); more generally, the αi\alpha_i jointly have to push deviations back toward equilibrium rather than away from it. And whenever cointegration holds, the Granger representation theorem guarantees at least one αi\alpha_i is nonzero — the error-correction form is not a modeling choice but a consequence of cointegration (Engle & Granger, 1987).

Exogeneity: Who Does the Adjusting

Put the first two VECM equations back on the table, this time looking only at the α\alpha‘s:

Δy1t=α1u^t−1+∑Γ1jΔyt−j+error1t\Delta y_{1t} = \alpha_1 \hat{u}_{t-1} + \sum \Gamma_{1j} \Delta \mathbf{y}_{t-j} + \text{error}_{1t} Δy2t=α2u^t−1+∑Γ2jΔyt−j+error2t\Delta y_{2t} = \alpha_2 \hat{u}_{t-1} + \sum \Gamma_{2j} \Delta \mathbf{y}_{t-j} + \text{error}_{2t}

If α1=0\alpha_1 = 0, then y1ty_{1t} is weakly exogenous for the cointegrating parameters: it does not adjust to deviations from equilibrium at all — the other variables do the restoring. You can then model y1ty_{1t} as a univariate process (an ARIMA, say) without losing any information about β\boldsymbol{\beta}.

Why does weak exogeneity matter? Note that it is not required for consistency — OLS estimation of the cointegrating regression is super-consistent even with endogenous regressors (Stock, 1987). What it buys you is efficiency: if α1=0\alpha_1 = 0, you can estimate the VECM in a smaller system that excludes the dynamic equation for y1ty_{1t}, with smaller standard errors. Testing is straightforward: test αi=0\alpha_i = 0 via a tt-test or Wald test in the VECM, and if you cannot reject, treat yity_{it} as weakly exogenous.

There is a stronger notion, strong exogeneity: αi=0\alpha_i = 0 and, in addition, all the coefficients on lagged Δyt\Delta \mathbf{y}_t in the equation for yity_{it} are zero. Under strong exogeneity the entire system splits into a series of independent equations with no cross-equation correlation. It is rarely satisfied in practice; it is enough to know it exists.

Where the Method Is Fragile

Engle-Granger is conceptually clean and computationally trivial — one OLS and one ADF, runnable in any software. But the cheapness has costs, and every one of them is documented in the literature.

The most fundamental limitation sits in the cointegration rank. The method tests for a single cointegrating relation — and recall that a system of KK variables can have rank up to K−1K - 1. When multiple cointegrating vectors actually exist, the test loses power, and that “which variable goes on the left” normalization choice from step 1 stops being harmless. With a unique cointegrating relation, different normalizations yield vectors that differ only by a scalar multiple, and inference is unchanged. With multiple vectors, different normalizations land on different directions in the cointegrating space — the vectors are no longer proportional, and the result genuinely depends on which variable you put on the left. In the bivariate case, reordering just gives you a proportional vector; with more variables, that guarantee is gone. Handling multiple vectors requires the Johansen method, covered in the next article.

Small samples are a practical problem too. Super-consistency is an asymptotic property; Banerjee, Dolado, Hendry, & Smith (1986) showed the bias in β^\hat{\boldsymbol{\beta}} can be substantial for T<100T < 100, and it propagates into the VECM, dragging the adjustment-speed estimates into inconsistency with it. Thirty years of monthly data is only 360 observations; daily data clears the bar easily but brings problems of its own. Know your sample size.

On power, Phillips & Ouliaris (1990) document that the test has low power against cointegration with weak long-run coefficients: when the relationship is real but loosely binding, the test frequently fails to see it. And the integration-order premise from earlier carries an extra bill here: the method assumes every variable is I(1), the asymptotics break down if some are I(2) or I(0), and the pre-testing that guards against this has its own error rates — another layer of noise on the whole procedure.

Finally, endogeneity. The right-hand-side variables of the cointegrating regression are endogenous in the VECM. This is fine for the long-run coefficients — super-consistency saves you — but the standard errors in the dynamic equations must account for it, and plain OLS standard errors there are inconsistent.

A Finance Example: The Term Structure

Here is a case where the cointegration hypothesis carries real economic content: the short rate rtr_t (say, the 3-month Treasury) and the long rate RtR_t (say, the 10-year Treasury yield). Both are persistent; both are driven by monetary policy and inflation expectations. If they are cointegrated, the spread Rt−rtR_t - r_t (or some scaled version of it) is stationary. That makes economic sense: the spread is the term premium, which should mean-revert over time as monetary policy and inflation expectations adjust.

The procedure runs exactly as above: regress RtR_t on rtr_t, Rt=α+βrt+utR_t = \alpha + \beta r_t + u_t; compute the residuals u^t\hat{u}_t; run the ADF on u^t\hat{u}_t with critical values from MacKinnon (1996). If the residuals are stationary, RtR_t and rtr_t are cointegrated, and the cointegrating vector (α,β)(\alpha, \beta) describes the long-run relationship between short and long rates.

Run this yourself on a long monthly sample of U.S. Treasury yields and the typical result is that the Engle-Granger test rejects no-cointegration at 5%, with an estimated β^\hat{\beta} below one — the long rate moves less than one-for-one with the short rate. The residuals u^t\hat{u}_t are highly persistent — high autocorrelation — but stationary. The exact numbers shift with the sample period; don’t memorize them as constants. In plain terms: short and long rates share a long-run equilibrium, the spread wanders away from it, and the wandering comes back.

The trading implication is direct. When the spread is far from its equilibrium value (large ∣u^t∣|\hat{u}_t|), expect reversion: go long the spread when it is too low, short when it is too high, with β^\hat{\beta} as the hedge ratio. But be clear about what the trade is betting on. The cointegrating relationship can break down entirely at regime changes — say, when the Fed changes its policy framework — and the Engle-Granger test, being purely in-sample, cannot catch that kind of rupture. Monitor the trade; don’t trust the test blindly.

Other Cointegrating Relations in Finance

Wherever theory posits an equilibrium relationship, a cointegration test has work to do — and the theory usually predicts what the cointegrating vector should look like. International finance supplies three classics. Purchasing Power Parity (PPP) says the real exchange rate is stationary, which is equivalent to the nominal exchange rate, the domestic price level, and the foreign price level being cointegrated; the test is to regress the log nominal exchange rate on log domestic and log foreign prices, then run the ADF on the residuals. Uncovered Interest Parity (UIP) says the expected change in the exchange rate equals the interest rate differential, implying the log exchange rate and the differential are cointegrated — but the empirical evidence is weak, and UIP violations are persistent. The Fisher effect says the nominal interest rate equals the real rate plus expected inflation, implying nominal rates and inflation are cointegrated.

In monetary economics, log money, log prices, and log income are cointegrated, and the cointegrating vector is the money demand function — a relationship that has been stable for many decades. On the rates side there is the term structure, just covered. In asset pricing, under a stable dividend discount model, log stock prices and log dividends are cointegrated — the testable form of present value models. And the most practical entry for traders: two cointegrated assets form the basis of a pairs trading strategy — the same logic as the term-structure trade above, deviation faded with β^\hat{\beta} as the hedge ratio, transplanted onto any cointegrated pair.

What makes this list valuable is that each theory predicts a specific cointegrating vector, so the empirical tests become verdicts on the theories: PPP, money demand, and the term structure are confirmed; UIP and the simple Fisher effect are rejected.

When Engle-Granger Is Enough

After the fragility list you might conclude the method is unusable. It isn’t. With two variables (K=2K = 2) and a single cointegrating relation, there is no rank problem and the normalization is harmless — using it is entirely reasonable. For exploratory analysis where you just want a quick read on whether cointegration is present, it is the cheapest answer available. And in theory-driven models where the cointegrating vector has a natural interpretation — the money demand equation log⁡M−log⁡P−log⁡Y=\log M - \log P - \log Y = constant, for instance — its estimate is directly readable.

Beyond that range, switch tools: more than two variables, multiple potential cointegrating vectors, or formal inference on the cointegrating parameters call for the Johansen method. That is the next article.

References

  • Banerjee, A., Dolado, J. J., Hendry, D. F., & Smith, G. W. (1986). Exploring equilibrium relationships in econometrics through static models: Some Monte Carlo evidence. Oxford Bulletin of Economics and Statistics, 48(3), 253-277.
  • Campbell, J. Y., Lo, A. W., & MacKinlay, A. C. (1997). The Econometrics of Financial Markets. Princeton University Press. Ch. 6.
  • Engle, R. F., & Granger, C. W. J. (1987). Co-integration and error correction: Representation, estimation, and testing. Econometrica, 55(2), 251-276.
  • Engle, R. F., & Yoo, B. S. (1987). Forecasting and testing in co-integrated systems. Journal of Econometrics, 35(1), 143-159.
  • Granger, C. W. J., & Newbold, P. (1974). Spurious regressions in econometrics. Journal of Econometrics, 2(2), 111-120.
  • Hamilton, J. D. (1994). Time Series Analysis. Princeton University Press. Ch. 19.
  • MacKinnon, J. G. (1996). Numerical distribution functions for unit root and cointegration tests. Journal of Applied Econometrics, 11(6), 601-618.
  • Phillips, P. C. B., & Ouliaris, S. (1990). Asymptotic properties of residual based tests for cointegration. Econometrica, 58(1), 165-193.
  • Stock, J. H. (1987). Asymptotic properties of least squares estimators of cointegrating vectors. Econometrica, 55(5), 1035-1056.
  • Tsay, R. S. (2010). Analysis of Financial Time Series (3rd ed.). Wiley. Ch. 7-8.