0
$\begingroup$

When estimating this VAR-model the returned coefficients on BNP.min4 and INT.min4 are NA, which I do not understand. My intuition is that there should not be any collinearity between these variables. The reason for the dummy's is to make the residuals normal, so by excluding the biggest outliers.

If anyone has any thought on why R is returning NA's on these dummy's and how to solve this that would be really helpful!

Below you will find the R code to recreate the results:

library(quantmod)
library(urca)
library(vars)
library(seasonal)
library(xtable)
library(tseries)


#Constant Price Gross Domestic Product in Sweden, Seasonally Adjusted
#Percent Change from Year Ago, Quarterly, Seasonally Adjusted
getSymbols("SWEGDPRQPSMEI", src = "FRED")
BNP <- ts(as.ts(SWEGDPRQPSMEI), start = c(1961, 1), frequency = 4)

#Unemployment Rate: Aged 15-64: All Persons for Sweden
#Percent, Quarterly, Seasonally Adjusted
getSymbols("LRUN64TTSEQ156S", src = "FRED")
U <- ts(as.ts(LRUN64TTSEQ156S), start = c(2001, 1), frequency = 4)


#Consumer Price Index: Total All Items for Sweden Growth Rate Previous Period,
#Not Seasonally Adjusted
getSymbols("CPALTT01SEQ657N", src = "FRED")
CPI <- ts(as.ts(CPALTT01SEQ657N), start = c(1960, 1), frequency = 4)

#Global price of Brent Crude
#U.S. Dollars per Barrel, Not Seasonally Adjusted
getSymbols("POILWTIUSDQ", src = "FRED")
OIL <- ts(as.ts(POILWTIUSDQ), start = c(1990, 1), frequency = 4)
OIL <- log(OIL)


#3-Month or 90-day Rates and Yields: Treasury Securities for Sweden
#Percent,Not Seasonally Adjusted
getSymbols("IR3TTS01SEQ156N", src = "FRED")
INT <- ts(as.ts(IR3TTS01SEQ156N), start = c(1982, 1), frequency = 4)

##SEASON AJDUSt##

# seasonal adjust time series using X11. 
CPI1 <- final(seas(as.ts((CPI),freq=4)))
OIL1 <- final(seas(as.ts((OIL),freq=4)))


sweden.data <- ts.intersect(OIL, U, BNP, CPI, INT)
#OIL & CPI S.ADJ
sweden.data1 <- ts.intersect(OIL1, U, BNP, CPI1, INT)
plot(sweden.data)
plot(sweden.data1)
# save(okun, file = "okun.rda")
# Data nedladdade 2018-12-11.


var.data1 <- window(sweden.data1, start=c(2001, 1), end=c(2019, 1))


var.sa <- ts.intersect(diff(var.data1[, "OIL1"]), diff(var.data1[, "U"]), var.data1[,"BNP"],var.data1[,"CPI1"], var.data1[,"INT"])
colnames(var.sa) <-c("DOIL", "DU","BNP","CPI","INT")
var.sa #OIL, Unemployment diffade

model.sa1<-VAR(var.sa, type = c("const"), p=1 ,ic = c("AIC"))

res.sa1<-residuals(model.sa1)
DOIL.min4 <- res.sa1[, "DOIL"] == min(res.sa1[, "DOIL"])
DU.max4 <- res.sa1[,"DU"] == max(res.sa1[,"DU"])
BNP.min4 <- res.sa1[, "BNP"] == min(res.sa1[, "BNP"])
INT.min4 <- res.sa1[, "INT"] == min(res.sa1[, "INT"])
var.sa.extDD <- cbind(DOIL.min4, DU.max4, BNP.min4,INT.min4)
var.sa.DD <- window(var.sa, start=c(2001, 3))



model.sano1<-VAR(var.sa.DD, type= "const", p=1, exogen = var.sa.extDD)
model.sano1

Estimated coefficients for equation INT: 
======================================== 
Call:
INT = DOIL.l1 + DU.l1 + BNP.l1 + CPI.l1 + INT.l1 + const + DOIL.min4 + DU.max4 + BNP.min4 + INT.min4 

    DOIL.l1       DU.l1      BNP.l1      CPI.l1      INT.l1       const   DOIL.min4     DU.max4    BNP.min4 
 0.79386673 -0.27122335  0.04046045  0.04209832  0.97891032 -0.12187917 -1.30325783 -0.12248275          NA 
   INT.min4 
         NA 
$\endgroup$
6
  • 1
    $\begingroup$ Please add a reproducible example for people to work with. $\endgroup$ Commented Nov 5, 2019 at 20:41
  • 1
    $\begingroup$ Could you show us how you know there is no collinearity? The code shown to construct the *.min4 and *.max4 variables strongly suggests the possibility of perfect collinearity. $\endgroup$
    – whuber
    Commented Nov 5, 2019 at 20:48
  • $\begingroup$ @gung-ReinstateMonica added the rest of the code, should work now $\endgroup$ Commented Nov 5, 2019 at 20:56
  • $\begingroup$ @whuber I don't know for sure, but my intuition is that there should be no collinearity since the dummy's are created from different data-series. I can on the otherhand be completly wrong about this. $\endgroup$ Commented Nov 5, 2019 at 20:57
  • $\begingroup$ Depending on the nature of the data--that is, assuming few data are tied at the maximum or minimum values--these variables appear to be almost all zeros. That leads to high multicollinearity as well as the possibility of perfect collinearity. You need to check. $\endgroup$
    – whuber
    Commented Nov 5, 2019 at 20:59

1 Answer 1

1
$\begingroup$

You have the line combining indicators

var.sa.extDD <- cbind(DOIL.min4, DU.max4, BNP.min4,INT.min4) 

apparently to set up the exogenous variables for model.sano1

But three of these DOIL.min4, BNP.min4, INT.min4 are identical: all FALSE except for the 30th value which is TRUE

So VAR seems to have chosen DOIL.min4 to give a coefficient and to have decided the presence of BNP.min4 and INT.min4 are unnecessary or undeirable

$\endgroup$
1
  • $\begingroup$ thank you for taking your time to look in to it! $\endgroup$ Commented Nov 6, 2019 at 8:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.