# Need help on cointegration

I tried to test stock pairs for pairs trading. There are two questions I am not sure.

1. I am not using ADF to test the log difference between two stocks. But I also see people using Johansen test. What's the difference? Should they in general output same results? What are the disadvantages for each test?

2. When using ADF test, I found that some pairs just don't make sense. Like the other post I saw on this site saying they found cointegration significant between hog futures and MSFT. For me, it's more like finding cointegration significant while the correlation is negative and so the hedging ratio is negative. For trading this kind of pairs, the shorted leg essentially don't provide any hedging for market risk at least in short term. So why do I get these results?

• Number 2: it's just a result of spurious correlation. – Clark Henry Sep 14 '14 at 3:45

Secondly, ADF test will suggest different test results when we switch the sequence of the inputs, while Johansen test is order independent as the latter is based on the eigenvector decomposition. Specifically, When performing Cointegrated ADF test, it first determines the optimal hedge ratio by running a linear regression between the two price series, use this hedge ratio to form a portfolio, and then finally run a stationarity test on this portfolio of price series. Therefore, using asset A as independent variable and asset B as dependent variable will likely to yield different results as the opposite case. Usually, only one hedge ratio among the two test cases can lead to a stationary portfolio, and one may need to run ADF test for both cases in order to find all possible hedge ratios. For the case of Johansen test, all the hedge ratios that can potentially lead to stationary portfolio for the $$n$$ assets are found all at once, which are the eigenvectors of the coefficient matrix.