Hi

With our stated background in stats, we should have realised that the
result you obtain is indeed surprising, since your t-stat is large, but
positive! A positive t-stat implies actually that your rho is bigger than
1... So in this case, you will not reject the alternative of stationarity,
but that of explosivity, try:

adf.test(stock2[,1], alternative="explosive")

That said, we should have also realised that results in adf.test seem to be
incorrect,  since they do not correspond to the ones in:
library(urca)
ur.df(stock2[,1], lags=12, type="trend")
# or the corresponding "ADF" regression from tsDyn:
library(tsDyn)
ar_ts <- linear(stock2[,1], m=12, include="both", type="ADF")
summary(ar_ts)$coef["phi.1",]

Both urca and tsDyn agree closely on the t-stat, at -2.4578550 for urca,
and -2.466884912 for tsDyn (differences come from the way of counting
degrees of freedom, urca discards the initial values, while tsDyn does not,
as in ar()). Looking closer at the code of adf.test(), it looks like the
regression is \Delta y_t = const + trend + y_t while I would have expected
a y_{t-1}. I guess code should be corrected as:
    xt1 <- x[(k-1):(n-1)]
instead of
    xt1 <- x[k:n]

once this done, adf.test does correspond to the others. And now Brian's
point that prices are usually non-stationary holds.

I am ccing the maintainer of tseries on this.

Best

Matthieu




2013/4/22 Brian G. Peterson <brian@braverock.com>

> On 04/21/2013 06:28 PM, Yitao Zhang wrote:
>
>> Hey guys,
>>
>> I'm trying to do a augmented Dickey-Fuller test to test the stationarity
>> of a stock price.
>>
>
> With your stated economics background, one would assume that you'd realize
> that price is almost never stationary.
>
> Perhaps try on returns?
>
> --
> Brian G. Peterson
> http://braverock.com/brian/
> Ph: 773-459-4973
> IM: bgpbraverock
>
>
> ______________________________**_________________
> R-SIG-Finance@r-project.org mailing list
> https://stat.ethz.ch/mailman/**listinfo/r-sig-finance<https://stat.ethz.ch/mailman/listinfo/r-sig-finance>
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.
>

	[[alternative HTML version deleted]]

