[R] ZA unit root test lag order selection
londonphd
r.otojanov at qmul.ac.uk
Tue Apr 16 13:47:46 CEST 2013
Dear Matthieu,
Many thanks for your reply.
I was not sure what the best way forward in selecting lag length. Eventually
I wrote a function that carries out serial correl test and AIC based lag
length selections. I used "urca" package.
Here is what I come up with in the end:
>zamod.A=ur.za(x, model="intercept",lag=j)
>AIC(eval(attributes(zamod.A)$testreg))
# for lag order selection
>bgtest(attributes(zamod.A)$testreg,order=3)$p.value # to test for
serial correlation
the final decision on the best model comes from examining the results of AIC
and BG tests.
Thanks,
Rosh
--
View this message in context: http://r.789695.n4.nabble.com/ZA-unit-root-test-lag-order-selection-tp4664183p4664350.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list