Cointegration Tests and VECM
Finding out why two prices that drift on their own never lose track of each other.
When the wholesale price of construction lumber rises, does the retail price rise by the same amount right away? In real markets, contract terms, inventories and distribution costs can make the two prices move differently in the short run. Even so, if a stable relationship between the wholesale and retail prices holds over time, the two series may have a long-run equilibrium.
The problem is that price data can keep rising or falling over time. Running a simple regression on nonstationary series like these can produce spurious regression, with high explanatory power and significant coefficients even when the real relationship is weak. The method for examining whether a long-run relationship exists in this situation is the cointegration test, and the model that analyzes how departures from the long-run relationship are corrected in the short run is the vector error correction model (VECM).
In this article we’ll use monthly price data to cover the difference between unit roots and cointegration, the Engle–Granger and Johansen tests, the cointegrating vector and the error-correction term, VECM estimation and diagnostics, and how to report the results.
What is cointegration?
Cointegration means that the individual time series are nonstationary but a particular linear combination of them is stationary.
Even if each of two prices moves with its own long-run stochastic trend, a linear combination representing the gap between them can move around a stable level. For example, let Wt be the wholesale price and Rt the retail price, and suppose the long-run relationship is as follows.
Rt = 12 + 1.15 Wt + ut
Here, if ut = Rt − 12 − 1.15Wt is a stationary series, then under suitable conditions the two prices can be considered cointegrated. This does not mean the difference between the two prices is the same every month. It means that even if they temporarily move away from equilibrium, the gap stays within a limited range in the long run.
The two series in the figure above were generated separately, with no relationship to each other at all.
Why check stationarity and unit roots first
Stationarity is the property that a time series’ statistical characteristics stay stable over time.
In a series with a unit root, by contrast, the effects of shocks persist for a long time, so the statistical characteristics of its levels can change over time.
The typical starting point of a cointegration analysis is checking whether each of the two variables is integrated of order one, that is, I(1). I(1) means a series that has a unit root in levels but is stationary in first differences. The ADF test and the KPSS test can be used to complement each other when checking this.
However, failing to reject the null hypothesis in an ADF test does not prove that a unit root exists. Because power can vary with the sample length, the trend specification and whether there are structural breaks, you should also look at the time-series plots and other diagnostics.
Worked example: wholesale and retail lumber prices
Suppose a building-materials distribution researcher collected monthly wholesale and retail prices of lumber over 10 years.
Prices were measured for a bundle of lumber of the same specification, in dollars. Both prices are assumed to be real prices, already adjusted for inflation.
| Item | Setting |
|---|---|
| Observation period | January 2016 – December 2025 |
| Frequency | Monthly |
| Observations | 120 months |
| Variable 1 | Wholesale price Wt ($/bundle) |
| Variable 2 | Retail price Rt ($/bundle) |
| Purpose | Analyze the long-run equilibrium and short-run adjustment between the prices |
The researcher expects that, even though the wholesale and retail prices each have their own long-run trend, a stable long-run relationship exists between them. The researcher also wants to check whether, when prices move away from the long-run equilibrium, subsequent monthly price changes tend to close the gap.
The research question is: "Do wholesale and retail lumber prices have a long-run equilibrium relationship, and when they move away from equilibrium, how fast does each price adjust?"
How do you read unit root test results?
Suppose we first analyzed the levels and first differences of both prices.
The following are the results of ADF tests with a constant. Whether to include a deterministic trend for the levels has to be decided separately based on the plots and the study design.
| Variable | ADF p-value, levels | ADF p-value, first differences | Preliminary judgment |
|---|---|---|---|
| Wholesale price | .34 | < .001 | Likely I(1) |
| Retail price | .27 | < .001 | Likely I(1) |
The null hypothesis of a unit root could not be rejected in levels but was rejected in first differences. So there are grounds for treating both variables as I(1) and proceeding with a cointegration analysis.
However, the fact that both prices have the same order of integration does not by itself mean they are cointegrated. Cointegration is a hypothesis about a long-run relationship that needs its own test.
How does the Engle–Granger test work?
The Engle–Granger two-step approach is a fairly intuitive way to examine whether two variables are cointegrated.
First you estimate the long-run regression in levels, then you test whether the residuals from that regression have a unit root. For example, suppose we estimated the following long-run equation.
R̂t = 12 + 1.15 Wt
Then check whether the residual ût = Rt − 12 − 1.15Wt is stationary. If the residuals are stationary, that is evidence of cointegration, meaning the two prices share a common stochastic trend.
Note that the critical values of the ordinary ADF test are not applied as-is to the estimated residuals. You must use critical values or p-values designed for cointegration tests, and the constant and trend specification of the regression also affects the test. In a multivariate setting where more than one cointegrating relationship is possible, the Johansen approach may be more natural.
What else does the Johansen test check?
The Johansen test is a method for evaluating the number of cointegrating relationships in a VAR system, that is, the cointegration rank.
The trace test and the maximum eigenvalue test are the standard versions. If two variables are I(1), the cointegration rank can be 0 or 1. Rank 0 means no cointegrating relationship was found, and rank 1 means there is one independent long-run relationship.
| Hypothesis tested | Trace statistic | 5% critical value | Decision |
|---|---|---|---|
| Cointegration rank r = 0 | 22.8 | 15.5 | Reject |
| Cointegration rank r ≤ 1 | 2.9 | 3.8 | Do not reject |
Critical values depend on how the deterministic terms are specified.
The first hypothesis is rejected but the second is not, so with this specification we can choose a cointegration rank of 1. This is consistent with there being one long-run equilibrium relationship between the wholesale and retail prices.
How does a VECM connect the long run and the short run?
A VECM links the short-run changes of cointegrated I(1) variables to deviations from the long-run equilibrium.
In general you can set up an equation with each of the two variables as the dependent variable. The most simplified retail price equation is as follows.
ΔRt = αR(Rt−1 − 12 − 1.15Wt−1) + γ ΔWt−1 + εR,t
Here the term in parentheses is last month’s deviation from the long-run equilibrium, which is called the error-correction term (ECT). αR is the adjustment coefficient showing how this deviation feeds into this month’s change in the retail price.
The full VECM can also include an equation for changes in the wholesale price, and each equation includes several lagged differences and any deterministic terms needed. So a VECM is not simply a regression with one residual added; it is a system that estimates the long-run relationship and the short-run dynamics together.
How do you interpret the error-correction coefficient?
Let us define the long-run equilibrium relationship as ECTt−1 = Rt−1 − 12 − 1.15Wt−1.
If the error-correction coefficient in the retail price equation is -0.30, then, with other short-run factors held equal, when last month’s retail price was $10 above its long-run equilibrium level, an adjustment pressure of about -$3 acts on this month’s change in the retail price.
−0.30 × 10 = −3
This is often described as correcting about 30% of the deviation from equilibrium in one period. In the full VECM, where both prices change at the same time, however, it does not mean the equilibrium error actually shrinks by exactly 30% every month, because adjustment of the wholesale price, short-run lag terms and new shocks are also at work.
The sign of the error-correction coefficient depends on which direction the ECT was defined in. So when interpreting results, always check how the cointegrating vector was normalized.
How do you interpret the VECM results?
Suppose we estimated a VECM with cointegration rank 1 on the lumber price data above.
To keep the explanation simple, the table shows only the main coefficients.
| Item | Estimated coefficient | p-value | Meaning |
|---|---|---|---|
| Long-run equation: wholesale price coefficient | 1.15 | — | Price relationship in the long-run equilibrium |
| ECT in the retail price equation | -0.30 | .004 | Retail price adjustment back to equilibrium |
| ECT in the wholesale price equation | 0.05 | .420 | No clear evidence of adjustment |
| Previous month’s wholesale price change in the retail price equation | 0.45 | .012 | Relationship between short-run price changes |
The error-correction coefficient for the retail price was significant at -0.30. This is consistent with the interpretation that when the retail price is above the long-run equilibrium, it adjusts downward. The adjustment coefficient in the wholesale price equation, on the other hand, was not significant, so in these data there is not enough evidence that the wholesale price responds actively to deviations from equilibrium.
A coefficient of 0.45 on the previous month’s wholesale price change means that, other model conditions being equal, when last month’s wholesale price rose by $1, this month’s change in the retail price tended to be $0.45 higher on average. This lagged relationship alone does not prove a causal effect of price pass-through, however.
How do you choose the number of lags and the deterministic terms in a VECM?
To set up a VECM, you need to decide on the number of lags in the VAR and on the constant, trend and other terms to include in the long-run relationship.
If the lags are too short, autocorrelation can remain in the residuals; if they are too long, degrees of freedom are used up and the estimates can become unstable. Information criteria such as AIC and BIC are usually used together with residual autocorrelation tests. Take care to check how the number of lags in the VAR in levels corresponds to the number of lagged differences in the VECM.
Also, the Johansen test and the estimation results can differ depending on whether the price series have a deterministic trend and whether a constant is allowed in the long-run equilibrium equation. So it’s important to keep the specification of the deterministic terms consistent between the testing stage and the model estimation stage.
What if there is no cointegrating relationship?
Just because two series are both I(1) does not mean you must use a VECM.
If the cointegration test finds no evidence of a long-run relationship, you can consider models such as a VAR on differences, which are stationary.
On the other hand, if the variables have different orders of integration or include I(2) variables, applying the standard I(1) Johansen VECM as-is may not be appropriate. A different approach is needed depending on the integration properties of the variables.
Also, if the long-run relationship itself changed because of a policy change or a restructuring of the distribution system, a model that applies a single cointegrating vector to the whole period may be inappropriate. Structural break tests and analyses by subperiod should be considered.
What to watch out for in VECM analysis
Do not confuse cointegration with correlation.
A high correlation coefficient is not sufficient evidence of cointegration. Cointegration is about whether a particular linear combination of nonstationary series is stationary.
Check the specifications of the unit root and cointegration tests.
Test results can vary with the trend term, the number of lags and the sample period, and when there are structural breaks a simple test can lead to the wrong conclusion.
Report the normalization of the cointegrating vector together with the sign of the adjustment coefficients.
If the ECT is defined in the opposite direction, the signs of the adjustment coefficients can also flip.
Check the diagnostic results as well.
Examine residual autocorrelation, heteroskedasticity, normality, model stability and so on, and assess whether the estimated model describes the data adequately.
Do not take a long-run relationship to be a causal relationship.
Even if wholesale and retail prices are cointegrated, that fact alone cannot tell you which price causes the other. Causal claims require institutional background or an additional identification strategy.
How do you report cointegration and VECM results?
A paper or report should give the observation period and frequency, the units and transformations of the variables, the unit root tests, the cointegration tests, the number of lags and the deterministic terms, and the VECM’s adjustment coefficients and short-run coefficients.
Stating the cointegration rank and the definition of the ECT makes the results easier to reproduce and interpret.
Example write-up
The long-run relationship and short-run adjustment process were analyzed using 120 monthly observations of wholesale and retail lumber prices from January 2016 to December 2025. ADF tests could not reject the null hypothesis of a unit root for either price in levels, while results for the first differences supported stationarity. In the Johansen trace test, the hypothesis of cointegration rank 0 was rejected, and the results were consistent with a specification of cointegration rank 1.
The long-run equilibrium relationship was normalized as Rt = 12 + 1.15Wt. In the VECM estimates, the error-correction coefficient in the retail price equation was -0.30 (p = .004), indicating adjustment that reduces the gap when the retail price moves away from the long-run equilibrium. The adjustment coefficient in the wholesale price equation, by contrast, was not statistically significant (p = .420). These results provide evidence of a long-run link between the two prices and an asymmetric pattern of short-run adjustment, but they do not directly establish the causal direction between the prices.
Cointegration describes the long-run equilibrium; a VECM describes the process of returning to it
A cointegration test examines whether a stable long-run relationship exists among time series that are individually nonstationary.
A VECM analyzes the short-run changes of cointegrated variables and their deviations from the long-run equilibrium together in a single system.
As in the lumber wholesale and retail price example, two prices can move differently from month to month yet maintain a stable relationship in the long run. The error-correction coefficient then shows how a departure from equilibrium feeds into later price changes. Rather than checking only the significance of the tests, though, you should also examine the variables’ orders of integration, the cointegration rank, the lag specification, residual diagnostics and the possibility of structural breaks.
The key is to go beyond whether two series move in a similar direction and analyze separately whether a long-run equilibrium relationship exists and what adjustment occurs when the series depart from it.