I have 3 variables which are all stationary at 2nd order difference. I want to check for cointegration using the piece of code below. If I run pairwise cointegration analysis then I get these results:
VARselect(f1[2:3], lag.max=10)$selection ## optimal no of lags to be 7 coint=ca.jo(f1[2:3], ecdet="none", type="trace", K=7, spec="longrun") summary(coint) ## indicates cointegrating relationship Values of teststatistic and critical values of test: test 10pct 5pct 1pct r <= 1 | 29.23 6.50 8.18 11.65 r = 0 | 75.18 15.66 17.95 23.52
This means that there is no cointegrating relationship between them. If I do this for other variables,
f1[c(2,4)] then I get one cointegrating relationship.
VARselect is used to choose the optimal lag. For all the variables together:
VARselect(f1[2:4], lag.max=10)$selection AIC(n) HQ(n) SC(n) FPE(n) 5 5 5 4 coint=ca.jo(f1[2:4], ecdet="none", type="trace", K=5, spec="longrun") summary(coint) Values of test statistic and critical values of test: test 10pct 5pct 1pct r <= 2 | 0.08 6.50 8.18 11.65 r <= 1 | 14.24 15.66 17.95 23.52 r = 0 | 39.67 28.71 31.52 37.22
- Do I need to take in all variable while running a VECM?
VARselectthe right way to choose the lag to be specified in
This would mean that there is cointegration between the variables and I need to run a VECM. But how do I know how many cointegrating relationships are there. As far as i have seen $r=2$ will be specified while doing a vecm
Is $r=2$ the correct way to specify a VECM?
cajorls(coint, r = 2) # or use this
Is this procedure that I am following a correct way to model?
- For 1. I think it is up to us to determine what kind of relationship we would like to examine and then set up a model!
- Ya its a iterative VAR to choose the right lag length.
- Not clear: so the highest rank I can not reject would be 2 for the 3 variable case?
Update 2: Regarding 3. I was asking for the
f1[2:4] where I produced the statistics. According to me there is only 1 cointegrating relationship. So $r=1$ in fitting a VECM.
- As my variables becomes stationary at 2nd order of difference, can I perform a Johansen co-integration which works at I(1)? Or do I have to feed in the first difference of my variables in order to perform Johansen co-integration.
- Also since using
VARselectthe optimal lag turned out to be
4. So I have to take
lag=3while running a cointegration model.