3

I am running an ADF test in R on the following series:

difference plot time series

This to me is clearly non-stationary, but when I run the ADF test:

library(tseries)
adf.test(spreads[,y]- spreads[,x], alternative="stationary")

For whatever lag value I use I get a low p-value indicating a stationary series:

p-value smaller than printed p-value

I just can't understand why this is stationary or why the test indicates that it is. I have several examples like this in my data set too.

Simon Nicholls
  • 153
  • 1
  • 7

1 Answers1

2

On a first glance your data seems to be trend stationary. That means that if you subtract the trend (in this case a straight line with positive slope) from the time-series you will have a stationary time series. Trend stationary data is not stationary before you subtract the trend.


Also note the official RDocumentation:

The general regression equation which incorporates a constant and a linear trend >is used and the t-statistic for a first order autoregressive coefficient equals >one is computed. The number of lags used in the regression is k. The default >value of trunc((length(x)-1)^(1/3)) corresponds to the suggested upper bound on >the rate at which the number of lags, k, should be made to grow with the sample >size for the general ARMA(p,q) setup. Note that for k equals zero the standard >Dickey-Fuller test is computed. The p-values are interpolated from Table 4.2, p. >103 of Banerjee et al. (1993). If the computed statistic is outside the table of >critical values, then a warning message is generated.

Missing values are not allowed

There are some exceptions, e.g. missing values.


Furthermore here:

What is the difference between a stationary test and a unit root test?

and here:

Contradictory results of ADF and KPSS unit root tests

and here:

ADF test, PP test, KPSS test: Which test to prefer?

I already explained situations, in which the Nullhypothesis of an ADF-test is rejected and a time series is not-stationary. You should apply a KPSS test for stationarity as well.

Reject unit root, reject stationarity: both hypothesis are component hypothesis >– heteroskedasticity in series may make a big difference; if there is structural >break it will affect inference.

Ferdi
  • 4,882
  • 7
  • 42
  • 62
  • Thank you this really helped, sorry it has been asked so many times, I didn't really know what to look for however. My KPSS test has a p values < 0.01, I think as the null hypothesis is the opposite of the ADF test I can reject the null hypothesis of trend stationary right? I'm simply trying to find co-integration between two time series and the plot is the difference between the two which are definitely not co-integrated. – Simon Nicholls Oct 16 '18 at 15:53
  • For Cointegration it is better to look for specialized cointegration tests, e.g. Johansen Test. – Ferdi Oct 16 '18 at 15:56
  • Thanks @Ferdi will have a look! I tried the engle granger test but was running into problems with the apparent time series' being stationary which perhaps they were just trend stationary. Is there a reason why the Johansen Test is preferable? – Simon Nicholls Oct 16 '18 at 16:02
  • I think both tests are suitable https://stats.stackexchange.com/questions/96789/whats-the-practical-difference-between-the-johansen-vs-engle-granger-tests-for – Ferdi Oct 16 '18 at 16:04
  • Just a small question about the Johansen test when only using two variables I’m a bit confused when I reject r0 but can’t reject r<=1 – Simon Nicholls Oct 17 '18 at 12:07
  • Thanks for the help, I now understand a lot more and I am using a slightly different package in r that does ADF with the three different regression equations, I specifically want constant but no linear trend, whereas the tseries adf function as you mentioned uses both. – Simon Nicholls Oct 19 '18 at 10:45