[R] Unit root
Brajkovic J.
Jurica.Brajkovic at soton.ac.uk
Tue Mar 24 09:03:25 CET 2009
I am confused by obtaining different results when testing for unit root when using different packages. I have 2625 price entries for which I want to determine whether they exhibit unit root. First I test using adf.test from tseries package by running:
> adf.test(P, k=30)
Augmented Dickey-Fuller Test
data: P
Dickey-Fuller = -4.685, Lag order = 30, p-value = 0.01
alternative hypothesis: stationary
Warning message:
In adf.test(P, k = 30) : p-value smaller than printed p-value
But adf.test includes a time trend that I wan to omit, which I do not know if it is possible. Thus I have to run ADF .test from uroot package and obtain the following:
ADF.test(Plevel, itsd=c(1,1,c(0)),regvar=0, selectlags=list(Pmax=30))
--------- ------ - ------ ----
Augmented Dickey & Fuller test
--------- ------ - ------ ----
Null hypothesis: Unit root.
Alternative hypothesis: Stationarity.
ADF statistic:
Estimate Std. Error t value Pr(>|t|)
adf.reg -0.326 0.015 -21.881 0.01
Lag orders: 30
Number of available observations: 2594
Warning message:
In interpolpval(code = code, stat = adfreg[, 3], N = N) : p-value is smaller than printed p-value
The results are dramatically different. Even more interesting is when I include the option for the program to select the number of lags:
ADF.test(Plevel, itsd=c(1,1,c(0)),regvar=0, selectlags=list(mode='signf', Pmax=NULL))
--------- ------ - ------ ----
Augmented Dickey & Fuller test
--------- ------ - ------ ----
Null hypothesis: Unit root.
Alternative hypothesis: Stationarity.
----
ADF statistic:
Estimate Std. Error t value Pr(>|t|)
adf.reg -0.079 0.017 -4.727 0.01
Lag orders: 1 2 3 4 5 6 9 10 11 12 13 14 15 16 17 18 19 20 21 23 24 25 26 27 28 31 32 33 34
Number of available observations: 2590
Warning message:
In interpolpval(code = code, stat = adfreg[, 3], N = N) :
p-value is smaller than printed p-value
Can someone please explain these differences.
Many thanks,
Jurica Brajkovic
University of Southampton
More information about the R-help
mailing list