I am trying to run the following code:
##Chen et al (2017) TVC-HAR model
library(tvReg)
TVCHAR <- tvAR (MyData$Pct_change_plus_250, p = 1, exogen = cbind (MyData$Pct_change_250), bw = 20)
print(TVCHAR)
but due to the fact that there are some NA values in MyData$Pct_change_250, I get the following error:
Error in tvAR(MyData$Pct_change_plus_250, p = 1, exogen = cbind(MyData$Pct_change_250), :
NAs in y.
How can I fix it?