What is an overall procedure for cointegration test?

I'm working on a set of macroeconomic variables form 1992M01 to 201407. They are PPI, CPI, industrial production, stock price index and exchange rate. I know that I should run a cointegration test for forecasting and it seems that the procedure is something like this:
1) testing for unit roots and stationarity 2) running Granger causality test 3) cointegration test Could anyone tell me about complete procedure, please?! what should I do in order to have a consistent regression of my variables? I've read so many references and I'm lost in texts!

• What do you mean by "consistent regression of my variables" ? Commented Jan 2, 2019 at 14:36
• Granger causality is normally not a part of cointegration testing. Check out a times series textbook for the whole procedure; pick a solid one and follow it. Commented Jan 3, 2019 at 6:45
• Yes, I know. I'm talking about pre cointegration tests which are needed to run. Commented Jan 3, 2019 at 7:27

You don't specify what software you are using to run these tests, but the examples I provide are carried out using R.

Stationarity

To start with, stationarity is a condition where the mean, variance, and autocorrelation is constant across a time series.

Here is a visual example below:

In order to carry out many facets of time series modelling, one needs a time series to be stationary for this purpose. This means 1) testing for stationarity, and 2) modifying a series to make it stationary if necessary.

As an example, consider two time series:

1. Oil prices
2. S&P 500 prices

These time series are largely trend-influenced, and will most likely not be stationary. However, this can formally be tested using the Dickey-Fuller test, whereby a p-value of greater than 0.05 indicates the null hypothesis of non-stationarity at the 5% level cannot be rejected.

> adf.test(gspc)

Augmented Dickey-Fuller Test

data:  gspc
Dickey-Fuller = -2.38, Lag order = 7, p-value = 0.4174
alternative hypothesis: stationary

Augmented Dickey-Fuller Test

data:  oil
Dickey-Fuller = -2.1883, Lag order = 7, p-value = 0.4986
alternative hypothesis: stationary


As we can see, p-values of greater than 0.4 indicate the null hypothesis of non-stationarity cannot be rejected, indicating that the series must be differenced in order to make them stationary. By first-differencing, we mean obtaining the difference between an observation at time t and time t-1.

> adf.test(diff_gspc)

Augmented Dickey-Fuller Test

data:  diff_gspc
Dickey-Fuller = -8.2973, Lag order = 7, p-value = 0.01
alternative hypothesis: stationary

Warning message:
In adf.test(diff_gspc) : p-value smaller than printed p-value

Augmented Dickey-Fuller Test

data:  diff_oil
Dickey-Fuller = -8.1493, Lag order = 7, p-value = 0.01
alternative hypothesis: stationary

Warning message:
In adf.test(diff_oil) : p-value smaller than printed p-value


In this instance, the p-values have dropped below 0.05, indicating that the null hypothesis of non-stationarity is rejected, i.e. a stationary series is present.

Granger Causality

Granger Causality is used to investigate whether a change in one time series "causes" a change in another. For instance, does a change in oil prices at time t-1 cause a change in the S&P 500 at time t? Let's test for orders 1 to 3, where order specifies the order of lags to include in the auxiliary regression.

order = 1

> grangertest(diff_oil ~ diff_gspc, order=1)
Granger causality test

Model 1: diff_oil ~ Lags(diff_oil, 1:1) + Lags(diff_gspc, 1:1)
Model 2: diff_oil ~ Lags(diff_oil, 1:1)
Res.Df Df      F  Pr(>F)
1    496
2    497 -1 4.4053 0.03633 *
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1


order = 2

> grangertest(diff_oil ~ diff_gspc, order=2)
Granger causality test

Model 1: diff_oil ~ Lags(diff_oil, 1:2) + Lags(diff_gspc, 1:2)
Model 2: diff_oil ~ Lags(diff_oil, 1:2)
Res.Df Df      F Pr(>F)
1    493
2    495 -2 2.2056 0.1113


order = 3

> grangertest(diff_oil ~ diff_gspc, order=3)
Granger causality test

Model 1: diff_oil ~ Lags(diff_oil, 1:3) + Lags(diff_gspc, 1:3)
Model 2: diff_oil ~ Lags(diff_oil, 1:3)
Res.Df Df      F Pr(>F)
1    490
2    493 -3 1.4792 0.2193


We see that the p-value is significant at order = 1, indicating that Granger causality exists between the two series when the lag length = 1.

Cointegration

Cointegration exists when two time series are non-stationary, but a linear combination of the two makes them stationary.

In other words, we wish to determine whether correlations between two series are actually significant, or simply exist due to chance.

Let's test the two series for cointegration using the egcm library in R.

> egcm(oil, gspc)
Y[i] =   6.5421 X[i] + 1768.1278 + R[i], R[i] =   0.9897 R[i-1] + eps[i], eps ~ N(0, 15.2265^2)
(0.4488)       (21.6567)                (0.0097)

R[501] = 55.7788 (t = 0.793)

WARNING: X and Y do not appear to be cointegrated.


The above indicates that cointegration does not exist between the two series, even though we have evidence of Granger Causality.

Hope the above helps, and as mentioned, the procedures for running the above will depend on which statistical software you are using.

References

• thanks for your immediate response. I'm using Eviews 10 to test time series. Your answer was very helpful for me. one more question: what about serial correlation, should I test series for serial correlation? what are the best test for it? Commented Jan 2, 2019 at 17:26
• If you are using linear regression, which I assume you are, then yes. You need to test for serial correlation. You should use the Durbin-Watson test for this purpose. Commented Jan 2, 2019 at 22:46