- The augmented Dickey–Fuller (ADF) test asks whether a time series has a unit root (it wanders with no fixed mean or trend to return to) or is stationary.
- Null hypothesis: unit root. A more negative test statistic than the critical value (or \( p < 0.05 \)) rejects it and points to stationarity.
- The critical values are not the usual \( t \) values: about −2.86 with a constant and −3.41 with a constant and trend at 5%, not −1.645.
- US log real GDP, 1959–2009: ADF = −2.383 against a 5% critical value of −3.433 (\( p = 0.389 \)), so we cannot reject a unit root. Its growth rate: ADF = −6.973, clearly stationary.
- Choose the deterministic terms from a plot, choose the lags with AIC or BIC, check the result is robust to the lag choice, and confirm with the KPSS test.
The augmented Dickey–Fuller test is the standard way to check whether a time series is stationary before you run a regression on it. It is also one of the most misread tests in econometrics: the null hypothesis is the opposite of what many people expect, the critical values are unusual, and the answer depends on choices (constant or trend, how many lags) that software makes quietly for you. This guide works through a real example, US quarterly GDP from 1959 to 2009, using the data and verified output from Econometrics Made Simple, Chapter 18, with code in Python, R and Stata.
Why stationarity matters
Regress US real consumption on real disposable income, quarter by quarter from 1959 to 2009, and you get an \( R^2 \) of 0.998. That looks like a perfect fit, but the Durbin–Watson statistic is 0.253 and the residuals wander away from zero for decades at a time. Any two series that drift upwards will look closely related, whether or not one drives the other.
The book’s simulation makes the danger concrete. Generate two independent random walks of 200 observations, regress one on the other, and the usual \( t \) test “finds” a significant relationship in 82% of samples, against the 5% it should. Granger and Newbold called this a spurious regression.[1] Run the same regression on the first differences and the rejection rate falls back to about 5%. Before you trust any regression between time series, you need to know which kind of series you have.
Stationary series and unit roots
The simplest model that shows the difference is the first-order autoregression
where \( e_t \) is white noise. If \( |\rho| < 1 \), shocks fade away and \( y_t \) keeps returning to its mean: the series is stationary. If \( \rho = 1 \), each shock is permanent and \( y_t \) is a random walk: its variance grows without limit. In the book’s simulation, the variance across 5,000 paths of an AR(1) with \( \rho = 0.8 \) stays near 2.8 at every date, while for a random walk it is 9.7 at \( t = 10 \), 100.6 at \( t = 100 \) and 198.4 at \( t = 200 \).
From Dickey–Fuller to the augmented Dickey–Fuller test
Subtract \( y_{t-1} \) from both sides of the AR(1) model and write \( \theta = \rho – 1 \):
Now a unit root (\( \rho = 1 \)) is \( \theta = 0 \), and stationarity (\( \rho < 1 \)) is \( \theta < 0 \). Dickey and Fuller proposed regressing \( \Delta y_t \) on \( y_{t-1} \) and using the \( t \) statistic on \( \hat{\theta} \).[2]
Real series rarely follow a pure AR(1). If the errors are autocorrelated, the simple test gives the wrong answer. The augmented test adds lagged differences to soak up that autocorrelation, and Said and Dickey showed this works for a wide class of models.[3] The full ADF regression is
with hypotheses
The test is one-sided: only large negative values of the statistic count against the unit root. That is why ADF statistics are reported as negative numbers.
Why the usual critical values are wrong
Under the null, \( y_{t-1} \) is a random walk, and the \( t \) statistic on \( \hat{\theta} \) does not follow a \( t \) or normal distribution. Its distribution is shifted to the left, so it is easy to get a negative value by chance. The book simulated it with \( T = 200 \) and 10,000 replications:
| Deterministic terms | 1% | 5% | 10% |
|---|---|---|---|
| Constant (simulated, \( T = 200 \)) | −3.49 | −2.86 | −2.55 |
| Constant and trend (simulated, \( T = 200 \)) | −4.10 | −3.43 | −3.13 |
| Constant (MacKinnon, large sample) | −3.43 | −2.86 | −2.57 |
| Constant and trend (MacKinnon, large sample) | −3.96 | −3.41 | −3.13 |
| For comparison: standard normal | −2.33 | −1.645 | −1.28 |
Using the normal 5% value of −1.645 by mistake would reject a true unit root in 45% of samples with a constant, and in 77% with a constant and trend (our simulation of 10,000 random walks, \( T = 200 \)). Software computes the correct critical values and \( p \)-values from MacKinnon’s response surfaces.[4]
Constant, trend or neither: which version of the ADF test?
The deterministic terms in the regression must match what the series could look like if it were stationary. Decide from a plot, before you look at any test result.
| Version | Use when the series… | Python / R / Stata |
|---|---|---|
| Constant and trend | trends upwards or downwards (log GDP, log prices, log consumption) | regression="ct" / type="trend" / trend |
| Constant only | has no trend but a non-zero mean (growth rates, interest rates, unemployment) | "c" / "drift" / default |
| Neither | fluctuates around zero by construction (rarely: some residuals or returns) | "n" / "none" / noconstant |
Getting this wrong is costly. Leave out the trend for a trending series and the test can almost never reject, because a stationary-around-a-trend series looks like a series that never returns to a fixed mean. Include an unnecessary trend and you lose power. For US log GDP, the version with a constant only gives −1.795 and the version with neither gives +4.958: meaningless numbers from the wrong question.
Worked example: is US real GDP stationary?
The file us_macro.csv holds real US quarterly data from 1959Q1 to 2009Q3 (203 quarters). Figure 1 plots the log of real GDP. It rises steadily, close to a linear trend of about 3.2% a year, but with long swings around that trend in recessions and booms. The question is whether those swings die out (trend-stationary) or are permanent (unit root).
Because the series trends, the right test includes a constant and a trend. Here is the ADF regression with two lagged differences (the number AIC chooses), estimated by OLS:
| Term | Coefficient | Std. error | \( t \) |
|---|---|---|---|
| Constant | 0.3245 | 0.134 | 2.43 |
| Trend \( t \) | 0.0003 | 0.0001 | 2.25 |
| \( y_{t-1} \) (this is \( \hat{\theta} \)) | −0.0400 | 0.0168 | −2.383 |
| \( \Delta y_{t-1} \) | 0.2766 | 0.070 | 3.96 |
| \( \Delta y_{t-2} \) | 0.1756 | 0.070 | 2.51 |
Use the output to test for a unit root in US log real GDP at the 5% level.
Note what the normal table would have said: \( -2.383 < -1.645 \), “reject”. The wrong critical value reverses the conclusion.
Now test the first difference, quarterly GDP growth (100 times the change in log GDP), shown in Figure 2. It has no trend, so use a constant only. AIC chooses one lag, and the statistic is −6.973 against a 5% critical value of −2.876 (\( p < 0.001 \)): reject the unit root decisively. Log GDP is I(1); its growth rate is I(0). That matches the classic finding of Nelson and Plosser that many US macroeconomic series behave like unit-root processes in levels.[5]
Running the ADF test in Python, R and Stata
Python (statsmodels)import numpy as np, pandas as pd
from statsmodels.tsa.stattools import adfuller
us = pd.read_csv("us_macro.csv")
y = np.log(us["realgdp"])
stat, p, lags, nobs, crit, _ = adfuller(y, regression="ct", autolag="AIC")
print(stat, p, lags, crit) # -2.383 0.389 2 {'5%': -3.433, ...}
g = 100 * y.diff().dropna()
print(adfuller(g, regression="c", autolag="AIC")[:2]) # (-6.973, 0.000)
R (urca)
library(urca)
y <- log(us$realgdp)
summary(ur.df(y, type = "trend", lags = 2)) # tau3 = -2.383
summary(ur.df(100 * diff(y), type = "drift", lags = 1)) # tau2 = -6.973
# or let it choose: ur.df(y, type = "trend", lags = 8, selectlags = "AIC")
Stata
import delimited using "us_macro.csv", clear
generate t = _n
tsset t
generate y = ln(realgdp)
generate g = 100 * D.y
dfuller y, trend lags(2) regress // ADF with constant and trend
dfuller g, lags(1) // ADF with constant only
Watch the argument names. In R, tseries::adf.test() always includes a constant and trend and sets the lags by a formula, so it can give a different answer from urca::ur.df(). In statsmodels, adfuller defaults to a constant only (regression="c"), which is wrong for a trending series.
How many lags should you use?
Too few lags leave autocorrelation in the errors and distort the test; too many waste observations and reduce power. The usual approach is to start from a maximum (statsmodels uses \( 12(T/100)^{1/4} \), a rule from Schwert[6]) and let an information criterion choose. Ng and Perron recommend a modified AIC for exactly this purpose.[7] For log GDP, AIC and BIC both choose 2 lags.
Whatever you choose, check that the conclusion survives other reasonable choices. Here is the ADF statistic for log GDP (constant and trend) with every lag length from 0 to 8:
| Lags | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|---|
| ADF | −1.085 | −1.608 | −2.383 | −2.494 | −2.260 | −2.466 | −2.559 | −3.036 | −2.997 |
| \( p \) | 0.932 | 0.789 | 0.389 | 0.331 | 0.456 | 0.345 | 0.299 | 0.122 | 0.133 |
The statistic moves around, but it never gets below the 5% critical value of about −3.43. The conclusion “cannot reject a unit root” is robust to the lag choice. If some reasonable lag lengths had rejected and others had not, the honest report would be that the evidence is mixed.
How to interpret ADF test results
| What you see | Decision | What to write |
|---|---|---|
| Statistic below (more negative than) the critical value; \( p < 0.05 \) | Reject \( H_0 \) | “The series is stationary (around a trend, if one was included).” |
| Statistic above the critical value; \( p \ge 0.05 \) | Do not reject \( H_0 \) | “We cannot reject a unit root; we treat the series as I(1).” |
Two cautions. First, “do not reject” is not proof of a unit root. The ADF test has low power against stationary series with \( \rho \) close to 1. In the book’s simulation with \( T = 200 \) (constant-only test), a stationary series with \( \rho = 0.95 \) was correctly identified only 33% of the time; with \( \rho = 0.9 \) the success rate rose to 88%. Second, the \( p \)-value is the probability of a statistic at least this negative if the series has a unit root; it is not the probability that the series is stationary.
Using the ADF and KPSS tests together
Because the ADF test is weak, it is good practice to pair it with the KPSS test, which reverses the hypotheses: its null is stationarity and its alternative a unit root.[8] Large KPSS values reject stationarity. Reading the two together gives four possible outcomes. Here are the US results from the book:
| Series | ADF (5% cv) | KPSS (5% cv) | Verdict |
|---|---|---|---|
| Log real GDP (trend) | −2.383 (−3.433): keep unit root | 0.207 (0.146): reject stationarity | Both point to I(1) |
| GDP growth | −6.973 (−2.876): reject | 0.324 (0.463): keep | Both point to I(0) |
| Inflation | −3.093 (−2.876): reject | 0.392 (0.463): keep | Borderline I(0) |
| Unemployment | −2.536 (−2.877): keep | 0.232 (0.463): keep | Inconclusive: the data cannot tell |
| Change in unemployment | −4.168 (−2.877): reject | 0.097 (0.463): keep | I(0) |
When both tests agree, you can be fairly confident. When neither rejects, as for unemployment, the sample is too short to separate a persistent stationary series from a unit root, and you should say so and check whether your conclusions change if you treat the series either way.
What to do after the ADF test
- Both variables I(0)? Ordinary time-series regression is fine (with HAC standard errors if the errors are autocorrelated).
- I(1) variables? Difference them, or use growth rates, before regressing one on another.
- I(1) variables that might share a long-run relationship? Test for cointegration: regress one on the other and test the residuals for a unit root. Do not use the ordinary ADF critical values for this step. For log consumption and log income, the residual statistic is −2.539, which would “reject” against the ordinary Dickey–Fuller 5% value of −1.942 for a model without a constant, but the correct Engle–Granger 5% critical value is −3.367 (\( p = 0.262 \)): no evidence of cointegration over this sample.
Practice questions
All statistics come from US quarterly data, 1959–2009.
EasyQ1. An ADF test with a constant on the Treasury-bill rate gives −2.039; the 5% critical value is −2.876. State the hypotheses and the conclusion. Show worked answer
EasyQ2. In an ADF regression, the coefficient on \( y_{t-1} \) is −0.04. What is the implied value of \( \rho \), and why does the test not simply use a normal table? Show worked answer
MediumQ3. For the unemployment rate, ADF = −2.536 (5% cv −2.877) and KPSS = 0.232 (5% cv 0.463). Interpret the two results together. Show worked answer
MediumQ4. Log real consumption gives ADF = −2.539 with a constant and trend (\( p = 0.309 \)), and its first difference gives −4.992 with a constant (\( p < 0.001 \)). What is its order of integration? Why was a trend included in the first test but not the second? Show worked answer
ExamQ5. An ADF regression for US log real GDP with a constant, a trend and two lagged differences gives \( \hat{\theta} \) \( = -0.0400 \) with standard error 0.0168, using 200 observations. (a) State the null and alternative hypotheses. [2] (b) Compute the test statistic and carry out the test at 5% (critical value −3.43). [3] (c) A student uses −1.645 instead. What does she conclude, and why is she wrong? [3] (d) What should be done to log GDP before using it in a regression with other I(0) variables? [2] Show worked answer
(b) \( \tau \) \( = -0.0400/0.0168 \) \( = -2.38 \) [1]. \( -2.38 > -3.43 \) [1], so do not reject: log GDP appears to have a unit root [1].
(c) \( -2.38 < -1.645 \), so she would reject and call log GDP trend-stationary [1]. But under \( H_0 \) the statistic follows the Dickey–Fuller distribution, which lies to the left of the normal [1]; with −1.645 a true unit root is rejected far more often than 5% of the time (about 77% of the time with a constant and trend, in simulations) [1].
(d) Take the first difference, i.e. use GDP growth, which is I(0) (ADF = −6.97) [2].
ExamQ6. Two researchers test log GDP with a constant and trend. One uses no lagged differences and gets −1.085; the other uses seven and gets −3.036. (a) Explain why the lag length changes the statistic. [2] (b) How should the lag length be chosen? [2] (c) Does either researcher reject a unit root at 5% (critical value −3.43)? [2] Show worked answer
(b) Start from a maximum such as \( 12(T/100)^{1/4} \) and choose by AIC, BIC or a modified AIC, then check robustness to nearby choices [2]. (AIC and BIC choose 2 here.)
(c) No: \( -1.085 \) and \( -3.036 \) are both above −3.43 [1]; every lag length from 0 to 8 gives the same conclusion [1].
Frequently asked questions
What is the null hypothesis of the augmented Dickey–Fuller test?
That the series has a unit root (it is non-stationary). The alternative is that it is stationary, or trend-stationary if a trend is included. Rejecting the null is evidence of stationarity.
How do I interpret the ADF p-value?
If \( p < 0.05 \), reject the unit root and treat the series as stationary. If \( p \ge 0.05 \), you cannot reject a unit root. A large \( p \)-value does not prove a unit root, because the test has low power against persistent stationary series.
What is the difference between the Dickey–Fuller and augmented Dickey–Fuller tests?
The original Dickey–Fuller test regresses \( \Delta y_t \) on \( y_{t-1} \) (plus a constant or trend). The augmented version adds lagged differences \( \Delta y_{t-1}, \dots, \Delta y_{t-p} \) so that the test remains valid when the errors are autocorrelated. The critical values are the same.
Why is the ADF test statistic negative?
It is the \( t \) statistic on \( \hat{\theta} \) \( = \hat{\rho} – 1 \). For a stationary series \( \rho < 1 \), so \( \theta \) is negative, and evidence against the unit root shows up as a large negative statistic. The test is one-sided to the left.
Should I include a constant or a trend?
Look at the plot. A trending series needs a constant and a trend; a series with a stable non-zero mean needs a constant only; the no-constant version is rarely appropriate. Decide before you see the result.
What if the ADF and KPSS tests disagree?
If ADF rejects and KPSS does not, the series is stationary; if KPSS rejects and ADF does not, it has a unit root. If both reject, there may be a structural break or long memory; if neither rejects, the data are not informative enough. Report the ambiguity.
How is the Phillips–Perron test different?
The Phillips–Perron test uses the simple Dickey–Fuller regression and corrects the statistic for autocorrelation and heteroskedasticity non-parametrically, instead of adding lagged differences.[9] It has the same null and the same critical values, and in practice usually leads to the same conclusion as the ADF test.
Studying more than one subject? The Complete Book Bundle gives you every Economics, Statistics, Mathematics and Econometrics book we publish in one download.
References
- Granger, C. W. J. and Newbold, P. (1974). Spurious regressions in econometrics. Journal of Econometrics, 2(2), 111–120.
- Dickey, D. A. and Fuller, W. A. (1979). Distribution of the estimators for autoregressive time series with a unit root. Journal of the American Statistical Association, 74(366), 427–431.
- Said, S. E. and Dickey, D. A. (1984). Testing for unit roots in autoregressive-moving average models of unknown order. Biometrika, 71(3), 599–607.
- MacKinnon, J. G. (1996). Numerical distribution functions for unit root and cointegration tests. Journal of Applied Econometrics, 11(6), 601–618.
- Nelson, C. R. and Plosser, C. I. (1982). Trends and random walks in macroeconomic time series: some evidence and implications. Journal of Monetary Economics, 10(2), 139–162.
- Schwert, G. W. (1989). Tests for unit roots: a Monte Carlo investigation. Journal of Business and Economic Statistics, 7(2), 147–159.
- Ng, S. and Perron, P. (2001). Lag length selection and the construction of unit root tests with good size and power. Econometrica, 69(6), 1519–1554.
- Kwiatkowski, D., Phillips, P. C. B., Schmidt, P. and Shin, Y. (1992). Testing the null hypothesis of stationarity against the alternative of a unit root. Journal of Econometrics, 54(1–3), 159–178.
- Phillips, P. C. B. and Perron, P. (1988). Testing for a unit root in time series regression. Biometrika, 75(2), 335–346.
- Wooldridge, J. M. (2020). Introductory Econometrics: A Modern Approach, 7th edn, Chapter 18 “Advanced Time Series Topics”. Boston: Cengage Learning.

