Johansen cointegration and VECM, step by step

When all your variables are I(1) and you suspect they move together in the long run, the Johansen procedure tells you how many long-run relationships exist, and the VECM shows how the system returns to equilibrium.

3 min readReviewed 2026-11-25EViews · Stata · R
M

Made for: Master's dissertation student

Your data is ready. The model isn't cooperating.

Sound familiar?

  • The Hausman test says one thing and your supervisor says another
  • Stata or EViews throws errors you can't decode at 1 a.m.
  • You're not sure your results are even the right ones to report
  • The deadline is fixed, and your supervisor has 20 other students

We diagnose your model, run it with you, and explain every number so you can defend it.

When to use Johansen

Use the Johansen (1988; Johansen & Juselius, 1990) procedure when:

  • all variables are I(1), confirmed by Unit root tests (ADF, KPSS);
  • you have two or more variables that may share one or more long-run relationships;
  • you want a system approach, treating variables as jointly determined.

If the variables have mixed orders of integration, use the ARDL bounds test instead.

Step by step

  1. Confirm I(1) for every variable.
  2. Choose the lag length from an unrestricted VAR in levels, using AIC, SIC, HQ or LR (EViews: View → Lag Structure → Lag Length Criteria). The VECM uses one lag fewer than the VAR.
  3. Choose the deterministic case: intercept and/or trend in the cointegrating equation and the VAR. Case 3 (intercept in both, no trend) is the most common for macro data.
  4. Run the Johansen test and read the trace and max-eigenvalue statistics.
  5. Decide the rank r (number of cointegrating vectors).
  6. If r ≥ 1, estimate a VECM with that rank. If r = 0, estimate a VAR in first differences.
  7. Interpret the normalised long-run coefficients and the adjustment coefficients (α).
  8. Diagnose: residual serial correlation (LM test), normality, and stability (all roots inside the unit circle).

Reading the Johansen test

Both statistics test the null hypothesis sequentially: r = 0, then r ≤ 1, then r ≤ 2, and so on.

Hypothesised rank Trace statistic 5% critical value Decision
None (r = 0) 58.4 47.9 Reject: at least one vector
At most 1 21.7 29.8 Don't reject: stop here

Here r = 1: one cointegrating relationship. If trace and max-eigenvalue disagree, report both and justify your choice (trace is often preferred; it is more robust to non-normality).

* Stata
varsoc lgdp linv lexp, maxlag(4)
vecrank lgdp linv lexp, lags(2) trend(constant)
vec lgdp linv lexp, lags(2) rank(1) trend(constant)
veclmar                 // serial correlation
vecstable, graph        // stability
# R (urca)
library(urca)
jo <- ca.jo(df[, c("lgdp","linv","lexp")], type = "trace", ecdet = "const", K = 2)
summary(jo)
vecm <- cajorls(jo, r = 1)

In EViews, open the variables as a group, then View → Cointegration Test → Johansen System Cointegration Test. Estimate the VECM via Quick → Estimate VAR → Vector Error Correction.

Interpreting the VECM

  • Normalised cointegrating vector: the long-run equation, normalised on your dependent variable. Watch the signs: EViews shows the vector as β′yₜ₋₁ = 0, so when you move terms across, signs flip.
  • Adjustment coefficients (α): the speed at which each variable corrects deviations from equilibrium. For the dependent variable you expect it to be negative and significant.
  • Short-run coefficients: effects of lagged differences.
  • Impulse responses and variance decomposition show dynamic effects over time.
  • Causality: a significant ECT signals long-run causality; Wald tests on lagged differences show short-run Granger causality.

How to report it

Example: Trace and maximum-eigenvalue tests both indicate one cointegrating vector at the 5% level. The normalised long-run relationship shows that a 1% rise in government expenditure is associated with a 0.31% rise in GDP. The adjustment coefficient of GDP is −0.27 (p < .01), implying that about 27% of the deviation from long-run equilibrium is corrected each year.

Common mistakes

  • Running Johansen with I(0) variables in the system: a stationary variable can create a spurious "cointegrating vector".
  • Using lag lengths from the VECM rather than the levels VAR.
  • Misreading signs in the normalised vector.
  • Ignoring structural breaks, which bias the test towards no cointegration.
  • Reporting impulse responses without explaining the identification (Cholesky ordering).

Frequently asked questions

What's the difference between Engle-Granger and Johansen?

Engle-Granger (two-step) tests one relationship using residuals from an OLS regression. Johansen tests for multiple relationships in a system and avoids normalisation issues. With more than two variables, Johansen is preferred.

My sample is only 30 years. Is Johansen OK?

It works, but the test has size distortions in small samples. A small-sample correction (Reinsel-Ahn) or ARDL as a robustness check strengthens your results.