# What is the correct unit root/stationarity test for this variable? Why do different tests provide different conclusions?

This is something of a follow up question to a previous question I had here: Can over differencing cause a singular matrix in a VAR model?

A brief recap of what I am trying to accomplish: I want to forecast employment for a city using a VARS model. The major variable being forecast is total non-farm employment along with various employment shares (such as percent of nonfarm employment tied to software). Many of these variables are inherently non-stationary, so I first differenced the variables.

However, when testing the stationarity of nonfarm employment, I found some interesting results. Using the Augmented Dickey Fuller test on the log of nonfarm employment resulted in the test saying the data was stationary.

Augmented Dickey-Fuller Test

data:  ln_nonfarm
Dickey-Fuller = -4.1498, Lag order = 4, p-value = 0.01
alternative hypothesis: stationary


I then did an ADF test on the first difference of nonfarm employment, which gave a result of the data being non-stationary.

Augmented Dickey-Fuller Test

data:  ln_nonfarm_d
Dickey-Fuller = -2.6703, Lag order = 4, p-value = 0.2991
alternative hypothesis: stationary


Puzzled by this, I then checked out the Phillips-Perron test on the log of nonfarm employment, which said the data was non-stationary (which I expected).

pp.test(ln_nonfarm)

Phillips-Perron Unit Root Test

data:  ln_nonfarm
Dickey-Fuller Z(alpha) = -5.4773, Truncation lag parameter = 3, p-value = 0.7989
alternative hypothesis: stationary


I then performed the Phillips-Perron test on the first difference of log of nonfarm employment, which provided a result that the data was now stationary.

pp.test(ln_nonfarm_d)

Phillips-Perron Unit Root Test

data:  ln_nonfarm_d
Dickey-Fuller Z(alpha) = -125.3459, Truncation lag parameter = 3, p-value =    0.01
alternative hypothesis: stationary


I then checked out the Kwiatkowski-Phillips-Schmidt-Shin test of the on the log of nonfarm employment and the first difference of nonfarm employment. The results of the two tests suggests that both the log and the first difference of nonfarm employment are not stationary.

Here is the KPSS test on log of nonfarm employment.

kpss.test(ln_nonfarm)

KPSS Test for Level Stationarity

data:  ln_nonfarm
KPSS Level = 2.9993, Truncation lag parameter = 2, p-value = 0.01


And here is the KPSS test on the first difference of logged nonfarm employment.

kpss.test(ln_nonfarm_d)

KPSS Test for Level Stationarity

data:  ln_nonfarm_d
KPSS Level = 0.1527, Truncation lag parameter = 2, p-value = 0.1


Of these tests, the only ones whose results make sense to me are the Phillips-Perron tests. I am curious as to why the other unit tests give contradictory results. What is the correct test and how should I transform the data so I can create an accurate forecast model? I have attached graphs of Logged Nonfarm Employment and First Differenced Logged Nonfarm Employment.

Thanks for your help, Sud

• Looking at the graphs, there seems to be quite a clear seasonal pattern. When neglected (as in the tests above), it may cause trouble. Have you considered using seasonally-adjusted data instead of raw data? – Richard Hardy Aug 10 '15 at 17:02
• No but I can try that instead. What is it about the seasonality that cause biased unit root test results? – Sud Sampath Aug 10 '15 at 17:07
• I do not intend to make general conclusions, but in this particular case seasonality stands out quite clearly. KPSS rejects stationarity in both levels and first differences, which is natural for seasonal data. I do not understand why ADF test performs as it does, though. I know too little about the mechanics of the PP test to comment on that one. – Richard Hardy Aug 10 '15 at 17:09
• @RichardHardy I have replaced the data with seasonally adjusted data. I now get consistent results across all tests (all first differences are non-stationary). Given that, what are the appropriate next steps to forecasting nonfarm employment given that I shouldn't use 2nd differencing? – Sud Sampath Aug 10 '15 at 18:11
• If you have a system of variables that all affect each other, perhaps with lags, then you could do a VAR model on the first differences of the data or a VECM model (the latter should be used if the levels of your variables are cointegrated). Also, a related answer is given here. – Richard Hardy Aug 10 '15 at 19:36