# Include a constant in a VAR model or not? Which model to use? VAR(1) or VAR(2) based on diagnostic checking?

First of all, I cannot find information if one should include or exclude a constant term in the VAR(p) model. Is there any relevant literature on this issue? The problem is that I have to specify if there is a constant or not for the the lag selection, estimation and IRFs as well.

Secondly, I am having hard times deciding which VAR model I should use. VAR(1) or VAR(2) in this case. The biggest question here for me: based on how many lags (h) can I conclude that there is residual autocorrelation or not? Have not found anything on that as well yet.

Here is my R code:

VARselect(DATA, lag.max = 4, type = "const")# 1 or 4 lags
var1<-VAR(DATA[5:58,],p = 1, type = "const")
var2<-VAR(DATA[5:58,], p = 2, type = "const")
var4<-VAR(DATA[5:58,],p = 4, type = "const")

Test for residual autocorrelation for each time series of VAR (5 in total) for VAR(1)

Box.test(resid1[,1],lag=3,type="Ljung-Box")# No Autocorrelation

Box.test(resid1[,2],lag=3,type="Ljung-Box")# Autocorrelation on 5%

Box.test(resid1[,3],lag=3,type="Ljung-Box")# No Autocorrelation

Box.test(resid1[,4],lag=3,type="Ljung-Box")# No Autocorrelation

Box.test(resid1[,5],lag=3,type="Ljung-Box")# Autocorrelation on 5%

For VAR(2) there is NO residual autocorrelation left for this lag lengh (h=3). But how vcan I be sure about the lag lengh? Results change with every other lag...

Portmanteau Test (adjusted) for small samples, multivariate

serial.test(var1, lags.pt = 16, type = "PT.adjusted")#serial correlation

serial.test(var2, lags.pt = 16, type = "PT.adjusted")#serial correlation

serial.test(var4, lags.pt = 16, type = "PT.adjusted")#serial correlation

Breusch-Godfrey LM test for small samples (Edgerton-Shukur F test), multivariate

serial.test(var1, lags.bg = 5, type = "ES")#serial correlation

serial.test(var2, lags.bg = 5, type = "ES")# no serial correlation

serial.test(var4, lags.bg = 5, type = "ES")#serial correlation

The default for the latter two tests is 16 and 5 lags, respectively. How can it be that when I test for each time series, VAR(2) has no residual autocorrelation left and the serial.test() finds it?