# how does Augmented Dickey Fuller results help to make the data stationary?

I have done an Augmented Dickey Fuller test on a variable without differencing it (or without making any transformations). Attached is my output. Now my question is how will this result (considering different scenarios of differenced lags, trends and drifts) help me out to make the series stationary?

Here my p-value is smaller for 4th lag. Does it mean I need to difference the data 4 times to make it stationary? I want to know how ADF RESULTS helps to make the data stationary. What exactly are the rules (depending on this results) which will make a times series stationary(not only for this particular series).

• Have you tried reading some time series textbook or a software manual with time series applications? There is plenty of good material out there both for beginners (e.g. the Stata time series manual, although I am not saying it is the best among the competition) and for advanced learners. Also, there are numerous questions on ADF testing here at Cross Validated and many of them have good answers. Have you tried looking at the posts under the tag augmented-dickey-fuller? – Richard Hardy Sep 18 '15 at 18:18

Here is a more detailed answer concerning the deterministic components.

The literature has differing opinions on what these mean, and the two views are summarized in my other answer and Richard Hardy's comment.

Below, I want to explain why I have my view. In particular, I want to argue that, in order to get the Dickey-Fuller distribution in the case of a Dickey-Fuller regression with constant, we need to adopt the view that the drift term vanishes under the null. Else, we would be in the case considered by West (Econometrica 1988). He indeed departs from the (null) model $y_t=\alpha+y_{t-1}+u_t$, which indeed yields a linear trend under the null, or, from writing $\Delta y_t=\alpha+u_t$, a mean in first differences.

He then however shows that in this case, the t-statistic will follow an asymptotic normal distribution under the null. Hence, not the Dickey-Fuller distribution. Heuristically, because the linear trend dominates the unit root under the null.

Now to the proof (which is basically from Hamilton's book, see pp. 490) that we do indeed get the Dickey-Fuller distribution in the constant case under the model I postulate below, i.e., that says that under the alternative, we have a stationary AR(1) around a non-zero mean but still a driftless random walk under the null.

(The most basic model $y_t=\rho y_{t-1}+u_t$ assumes a zero mean - see above table - , which is not realistic for most economic time series. That is, one would reject in favor of the model $y_t=\rho y_{t-1}+u_t$, $|\rho|<1$. In this case, there is no issue of distinguishing between different view on the deterministic components, as there are none. Also, entirely analogous arguments as in the with-constant case result when it comes to including a trend, but I omit these for brevity.)

Let us therefore consider the model \begin{align*}y_t&=\psi+\tilde{y}_t\\ \tilde{y}_t&=\rho \tilde{y}_{t-1}+u_t \end{align*} Rearrange this to $y_t-\psi=\tilde{y}_t$, insert and solve for $y_t$ to get $$y_t=\psi(1-\rho)+\rho y_{t-1}+u_t$$ So $y_t$ is a random walk if $\rho=1$ and a stable $AR(1)$ under the alternative.

To account for this non-zero mean, we include an intercept in our regression $$y_t=\alpha+\rho y_{t-1}+u_t$$ We look at the sampling error under $H_0:\rho=1$ (and thus $\alpha=0)$. The OLSE is $$\begin{pmatrix} \hat{\alpha}_T \\ \hat{\rho}_T \\ \end{pmatrix}=\begin{pmatrix} T & \sum_ty_{t-1} \\ \sum_ty_{t-1} & \sum_ty_{t-1}^2 \\ \end{pmatrix}^{-1} \begin{pmatrix} \sum_ty_t \\ \sum_ty_{t-1}y_t \\ \end{pmatrix}$$ Hence, we can show that $$\begin{pmatrix} \hat{\alpha}_T \\ \hat{\rho}_T-1 \\ \end{pmatrix}=\begin{pmatrix} T & \sum_ty_{t-1} \\ \sum_ty_{t-1} & \sum_ty_{t-1}^2 \\ \end{pmatrix}^{-1} \begin{pmatrix} \sum_tu_t \\ \sum_ty_{t-1}u_t \\ \end{pmatrix}$$ We have a coefficient on a "standard" variable (a constant) as well as one on a nonstationary one ($y_{t-1}$). It turns out we need to assign two different convergence rates, $$\Upsilon:=\begin{pmatrix} \sqrt{T} & 0 \\ 0 & T \\ \end{pmatrix}$$

We can then rewrite the previous display as \begin{align*} \Upsilon\begin{pmatrix} \hat{\alpha}_T \\ \hat{\rho}_T-1 \\ \end{pmatrix}&=\Upsilon\begin{pmatrix} T & \sum_ty_{t-1} \\ \sum_ty_{t-1} & \sum_ty_{t-1}^2 \\ \end{pmatrix}^{-1}\Upsilon \Upsilon^{-1}\begin{pmatrix} \sum_tu_t \\ \sum_ty_{t-1}u_t \\ \end{pmatrix}\\ &=\left[\Upsilon^{-1}\begin{pmatrix} T & \sum_ty_{t-1} \\ \sum_ty_{t-1} & \sum_ty_{t-1}^2 \\ \end{pmatrix}\Upsilon^{-1}\right]^{-1} \Upsilon^{-1}\begin{pmatrix} \sum_tu_t \\ \sum_ty_{t-1}u_t \\ \end{pmatrix} \end{align*} where $$\Upsilon^{-1}=\begin{pmatrix} 1/\sqrt{T} & 0 \\ 0 & 1/T \\ \end{pmatrix}$$ Hence, $$\begin{pmatrix} \sqrt{T}\hat{\alpha}_T \\ T(\hat{\rho}_T-1) \\ \end{pmatrix}=\begin{pmatrix} 1 & T^{-3/2}\sum_ty_{t-1} \\ T^{-3/2}\sum_ty_{t-1} & T^{-2}\sum_ty_{t-1}^2 \\ \end{pmatrix}^{-1} \begin{pmatrix} T^{-1/2}\sum_tu_t \\ T^{-1}\sum_ty_{t-1}u_t \\ \end{pmatrix}$$

Using standard results on weak convergence to functionals of Brownian motion, we obtain \begin{align*} \begin{pmatrix} 1 & T^{-3/2}\sum_ty_{t-1} \\ T^{-3/2}\sum_ty_{t-1} & T^{-2}\sum_ty_{t-1}^2 \\ \end{pmatrix}&\Rightarrow\begin{pmatrix} 1 & \sigma\int_0^1W(r)d r \\ \sigma\int_0^1W(r)d r & \sigma^2\int_0^1[W(r)]^2d r \\ \end{pmatrix}\\ &=\begin{pmatrix} 1 & 0 \\ 0 & \sigma \\ \end{pmatrix}\begin{pmatrix} 1 & \int_0^1W(r)d r \\ \int_0^1W(r)d r & \int_0^1[W(r)]^2d r \\ \end{pmatrix}\\ &\qquad\times\;\begin{pmatrix} 1 & 0 \\ 0 & \sigma \\ \end{pmatrix}\\ &\equiv \Sigma \begin{pmatrix} 1 & \int_0^1W(r)d r \\ \int_0^1W(r)d r & \int_0^1[W(r)]^2d r \\ \end{pmatrix} \Sigma \end{align*} Similarly, using well-known weak convergence results for the second entry, $$\begin{pmatrix} T^{-1/2}\sum_tu_t \\ T^{-1}\sum_ty_{t-1}u_t \\ \end{pmatrix}\Rightarrow \sigma\Sigma\begin{pmatrix} W(1)\\ 1/2\{W(1)^2-1\}\\ \end{pmatrix}$$

Together, this yields \begin{align*} \begin{pmatrix} \sqrt{T}\hat{\alpha}_T \\ T(\hat{\rho}_T-1) \\ \end{pmatrix}&\Rightarrow\sigma\begin{pmatrix} 1 & 0 \\ 0 & 1/\sigma \\ \end{pmatrix} \begin{pmatrix} 1 & \int_0^1W(r)d r \\ \int_0^1W(r)d r & \int_0^1[W(r)]^2d r \\ \end{pmatrix}^{-1}\\ &\times\; \Sigma^{-1}\Sigma\begin{pmatrix} W(1)\\ 1/2\{W(1)^2-1\}\\ \end{pmatrix}\\ &=\begin{pmatrix} \sigma & 0 \\ 0 & 1 \\ \end{pmatrix} \begin{pmatrix} 1 & \int_0^1W(r)d r \\ \int_0^1W(r)d r & \int_0^1[W(r)]^2d r \\ \end{pmatrix}^{-1}\\ &\times\; \begin{pmatrix} W(1)\\ 1/2\{W(1)^2-1\}\\ \end{pmatrix}\\ \end{align*} The inverse is $$\Delta^{-1}\begin{pmatrix} \int_0^1[W(r)]^2d r & -\int_0^1W(r)d r \\ -\int_0^1W(r)d r & 1 \\ \end{pmatrix}$$ where $$\Delta\equiv\int_0^1[W(r)]^2d r-\left[\int_0^1W(r)d r\right]^2$$

All in all, this means that the second element of the scaled error converges to \begin{align*} T(\hat{\rho}_T-1)&\Rightarrow\frac{1/2\{W(1)^2-1\}-W(1)\int_0^1W(r)d r}{\Delta}\\ &=\frac{1/2\{W(1)^2-1\}-W(1)\int_0^1W(r)d r}{\int_0^1[W(r)]^2d r-\left[\int_0^1W(r)d r\right]^2} \end{align*} Using analogous arguments, we can find a $t$-ratio type distribution, $$t_{T,\alpha}\Rightarrow\frac{1/2\{W(1)^2-1\}-W(1)\int_0^1W(r)d r}{\left\{\int_0^1[W(r)]^2d r-\left[\int_0^1W(r)d r\right]^2\right\}^{1/2}}$$ This is the distribution that is used to produce the p-values in for example the above output - implying that this is the model we need to have in mind if these are p-values we wish to trust in.

• What do I think? Certainly a valuable contribution! I am also overwhelmed by the formulas :) Also, I would believe you even without the proof as long as there is some reference given. But I think I am losing the big picture now. Could you indicate in a "for dummies" manner how my understanding of each of the three alternatives matches/mismatches your view? I think you have only discussed alternative (1). But maybe I am asking too much :) Also, in paragraph 6 you have the same formula twice. Shouldn't the second one have an intercept? – Richard Hardy Sep 19 '15 at 12:08
• I made some edits, maybe things get a little clearer :). In fact, I discuss alternative (2), "single mean". The 2nd time in par 6 is just to emphasize that one is under the alternative there. – Christoph Hanck Sep 19 '15 at 18:52
• OK, I never intended to question the validity of the unit root asymptotics under the different specifications. My comment on your first answer was that perhaps you are misinterpreting what stands behind the three names (zero mean, single mean, trend) in the output of that particular software package, although I don't know what package that is. For example, I think in "urca" package in R, the ur.dffunction will have the following three alternatives (1) no intercept in first differences; (2) intercept in first differences; (3) intercept + trend in first differences. Does that make sense? – Richard Hardy Sep 19 '15 at 19:05
• Indeed - possibly the OP could help us with knowing what package was used, yes! (I am not sure what urca does, but it could still "just" refer to the way the test regression is run, which does not circumvent the need to think about what the underlying statistical (null) model one has in mind used to derive the corresponding limiting null distribution of the test statistic actually is.) – Christoph Hanck Sep 19 '15 at 19:10
• I agree. Essentially, I just tried to warn that the terminology might be confusing/deceptive. It would indeed be good to know what software was used and how its terminology works. On the other hand, once the terminology is clear, I would normally trust the software (as long as it is a popular enough package) to have the correct null distributions for whatever alternative test regression specifications are implemented. Meanwhile, your answer is useful in that it could help develop a new test function from scratch. – Richard Hardy Sep 19 '15 at 19:14

The lags are to control for serial correlation, you can't just pick one of them. And they are totally unrelated to the issue of how often you need to difference.

Instead, if you do not reject the null of a unit root in the series (because the p-value ("$Pr<rho$") is higher than a threshold like 0.05, you would need to difference the series once. You can then do another unit root test to see whether the differences also need to be differenced to achieve stationarity.

As to how many lags you should employ, you may resort to information criteria, for example, that many packages report.

As to whether you should be looking at zero mean, single mean or trend results depends on what seems plausible (or else, there are procedures for that, too) regarding the behavior of the series under the alternative of stationarity. Does it fluctuate around a zero mean, a non-zero mean, or does it behave like a trend stationary process, respectively?

• I think the (1) zero mean, (2) single mean and (3) trend applies to the first differences, hence the data in levels would (1) have no trend, (2) have a linear trend or (3) have a quadratic trend, respectively. Also, I would change how often you need to difference into how many times you need to difference to make it more concrete. – Richard Hardy Sep 18 '15 at 18:14
• @RichardHardy, I have posted another answer on this issue so as not to burden this one too much. Let me know what you think! – Christoph Hanck Sep 19 '15 at 11:01