cointergration test

Trying to run a cointegration test

code : cointest<-ca.jo(dataz, K=5, type="eigen", ecdet = "const", spec = "transitory")
summary(cointest)

response am getting: cointest<-ca.jo(dataz, K=5, type="eigen", ecdet = "const")
Error in dimnames(x) <- dn :
length of 'dimnames' [2] not equal to array extent

Your error indicates a problem with dataz
What is it ... perhaps a data.frame, or a matrix or something else?
what are its dimensions ?
what are the columnwise dimension names ? i.e.

dimnames(dataz)[2]

i have 5 variables

dataz=cbind(ERPT_Gabriel$lCPI,ERPT_Gabriel$LCU,ERPT_Gabriel$LOIL,ERPT_Gabriel$LNER,ERPT_Gabriel$LGDP)

so this is running well but when i try to do cointegration its not

ok, cbind constructs a bare matrix for you, lacking dimension names, i.e. no column names, i.e. no ICP not LCU etc.
The easy modern way to data manipulate in R involves the tidyverse which you can learn from this resource https://r4ds.had.co.nz/
but in base R you can do:

dataz <- subset(ERPT_Gabriel,
                    select= c(lCPI,LCU,LOIL,LNER,LGDP))

thank you very much it worked

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.