# [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:
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:

--------- ------ - ------ ----
Augmented Dickey & Fuller test
--------- ------ - ------ ----
Null hypothesis: Unit root.
Alternative hypothesis: Stationarity.
Estimate Std. Error t value Pr(>|t|)

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:

--------- ------ - ------ ----
Augmented Dickey & Fuller test
--------- ------ - ------ ----

Null hypothesis: Unit root.
Alternative hypothesis: Stationarity.

----

Estimate Std. Error t value Pr(>|t|)

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

```