Instant PDF download, name-and-email checkout. Complete Book Bundle: every Economics, Statistics, Mathematics and Econometrics book
Econometrics

The Augmented Dickey–Fuller Test: Stationarity and Unit Roots Explained

How to run and interpret the augmented Dickey–Fuller (ADF) test, step by step, using real US quarterly GDP from 1959 to 2009: the unit-root null, Dickey–Fuller critical values, choosing a constant or trend and the lag length, and pairing ADF with KPSS.

In 30 seconds
  • 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

\[ y_t = \rho\,y_{t-1} + e_t \]

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 \).

Key termsA series is (weakly) stationary if its mean, variance and autocovariances do not change over time. A series has a unit root if \( \rho = 1 \) in its autoregressive representation; it is then integrated of order one, I(1), and its first difference \( \Delta y_t \) \( = y_t – y_{t-1} \) is stationary, I(0). A trend-stationary series is stationary around a deterministic trend.[10]
Econometrics Made Simple textbook coverChapter 18 of Econometrics Made Simple covers stationarity, Dickey–Fuller and KPSS tests and spurious regression, with simulations you can run yourself.Get the textbook · $15

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 \):

\[ \Delta y_t = \theta\,y_{t-1} + e_t \]

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

\[ \Delta y_t = \alpha + \delta t + \theta\,y_{t-1} \] \[ + \gamma_1\Delta y_{t-1} + \cdots + \gamma_p\Delta y_{t-p} + e_t \]

with hypotheses

\[ H_0: \theta = 0 \;\text{(unit root)} \] \[ H_1: \theta < 0 \;\text{(stationary)} \]

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 terms1%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.

VersionUse when the series…Python / R / Stata
Constant and trendtrends upwards or downwards (log GDP, log prices, log consumption)regression="ct" / type="trend" / trend
Constant onlyhas no trend but a non-zero mean (growth rates, interest rates, unemployment)"c" / "drift" / default
Neitherfluctuates 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).

US log real GDP, 1959Q1–2009Q3
log real GDPFitted linear trend
1960197019801990200020107.88.28.69.09.4log real GDPADF = −2.383, 5% cv −3.433: unit root not rejected
Figure 1. Log real GDP rises at about 3.2% a year but makes long swings around the trend, up to 0.11 below it and 0.07 above. Data: us_macro.csv (real US data), Econometrics Made Simple, Chapter 18.

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:

TermCoefficientStd. error\( t \)
Constant0.32450.1342.43
Trend \( t \)0.00030.00012.25
\( y_{t-1} \) (this is \( \hat{\theta} \))−0.04000.0168−2.383
\( \Delta y_{t-1} \)0.27660.0703.96
\( \Delta y_{t-2} \)0.17560.0702.51
Worked example

Use the output to test for a unit root in US log real GDP at the 5% level.

Step 1Hypotheses: \( H_0: \theta = 0 \) (unit root) against \( H_1: \theta < 0 \) (trend-stationary).
Step 2Estimate: \( \hat{\theta} \) \( = -0.0400 \), so \( \hat{\rho} \) \( = 1 + \hat{\theta} \) \( = 0.96 \). Close to 1, but is it significantly below 1?
Step 3Test statistic: \( \tau \) \( = -0.0400/0.0168 \) \( = -2.383 \), from \( T = 200 \) usable observations.
Step 4Critical value (constant and trend, 5%): −3.433. Since \( -2.383 > -3.433 \), the statistic is not negative enough.
Step 5Decision: do not reject \( H_0 \) (\( p = 0.389 \)). The data are consistent with a unit root in log GDP: shocks to output appear to be permanent.

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]

US real GDP growth, % per quarter
Growth (100 × change in log GDP)Mean (0.78%)
196019701980199020002010−2−101234% per quarterADF = −6.973, 5% cv −2.876: stationary
Figure 2. Growth has no trend and keeps returning to its mean of about 0.8% a quarter. Data: us_macro.csv, Econometrics Made Simple, Chapter 18.

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:

Lags012345678
ADF−1.085−1.608−2.383−2.494−2.260−2.466−2.559−3.036−2.997
\( p \)0.9320.7890.3890.3310.4560.3450.2990.1220.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.

Econometrics Made Simple Practice Questions coverDrill unit-root tests, cointegration and forecasting with over 1,150 econometrics questions and fully worked answers.Get the questions · $9

How to interpret ADF test results

What you seeDecisionWhat 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:

SeriesADF (5% cv)KPSS (5% cv)Verdict
Log real GDP (trend)−2.383 (−3.433): keep unit root0.207 (0.146): reject stationarityBoth point to I(1)
GDP growth−6.973 (−2.876): reject0.324 (0.463): keepBoth point to I(0)
Inflation−3.093 (−2.876): reject0.392 (0.463): keepBorderline I(0)
Unemployment−2.536 (−2.877): keep0.232 (0.463): keepInconclusive: the data cannot tell
Change in unemployment−4.168 (−2.877): reject0.097 (0.463): keepI(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.
Common mistakeReading the ADF result backwards. The null is the unit root, so a small \( p \)-value means stationary. Students often write “p = 0.389, so the series is stationary”. The correct reading is “we cannot reject a unit root”.
Common mistakeComparing the ADF statistic with \( t \)-table or normal critical values, or comparing in the wrong direction. The rejection region is to the left: reject when the statistic is more negative than a critical value such as −3.43. A statistic of −2.38 is not more negative than −3.43.
Exam tipA full-marks ADF answer states (1) the regression, including whether a constant and trend are included and why; (2) \( H_0: \theta = 0 \) (unit root) and \( H_1: \theta < 0 \); (3) the test statistic and the Dickey–Fuller critical value, with a sentence on why normal critical values cannot be used; (4) the decision and its meaning, for example “log GDP is I(1); difference it before regressing”.

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
\( H_0 \): the T-bill rate has a unit root; \( H_1 \): it is stationary. Since \( -2.039 > -2.876 \), the statistic is not negative enough: do not reject \( H_0 \) (\( p = 0.27 \)). We cannot reject a unit root in the T-bill rate.
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
\( \hat{\rho} \) \( = 1 + \hat{\theta} \) \( = 1 – 0.04 \) \( = 0.96 \). Under the null, \( y_{t-1} \) is a random walk, so the \( t \) statistic does not have a \( t \) or normal distribution; its distribution is shifted left and needs Dickey–Fuller critical values.
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
ADF: \( -2.536 > -2.877 \), do not reject a unit root. KPSS: \( 0.232 < 0.463 \), do not reject stationarity. Neither null is rejected, so the result is inconclusive: the sample cannot distinguish a highly persistent stationary series from a unit root.
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
Levels: do not reject a unit root. Differences: reject. So log consumption is I(1). The level trends upwards, so a stationary alternative must allow for a trend; the difference (consumption growth) has a constant mean and no trend.
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
(a) \( H_0: \theta = 0 \), log GDP has a unit root [1]; \( H_1: \theta < 0 \), it is stationary around a linear trend [1].
(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
(a) GDP growth is autocorrelated; without lagged differences that autocorrelation stays in the error and biases the test [1]; adding lags changes the estimate of \( \theta \) and its standard error [1].
(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.

Econometrics Made Simple Complete Bundle coverUnit roots, cointegration, forecasting and an empirical project guide: get the textbook and the practice questions for $19 (was $24).Get the bundle · $19

References

  1. Granger, C. W. J. and Newbold, P. (1974). Spurious regressions in econometrics. Journal of Econometrics, 2(2), 111–120.
  2. 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.
  3. 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.
  4. MacKinnon, J. G. (1996). Numerical distribution functions for unit root and cointegration tests. Journal of Applied Econometrics, 11(6), 601–618.
  5. 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.
  6. Schwert, G. W. (1989). Tests for unit roots: a Monte Carlo investigation. Journal of Business and Economic Statistics, 7(2), 147–159.
  7. 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.
  8. 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.
  9. Phillips, P. C. B. and Perron, P. (1988). Testing for a unit root in time series regression. Biometrika, 75(2), 335–346.
  10. Wooldridge, J. M. (2020). Introductory Econometrics: A Modern Approach, 7th edn, Chapter 18 “Advanced Time Series Topics”. Boston: Cengage Learning.
Statistics Made Simple Complete Bundle cover showing both the textbook and practice book
Statistics Made Simple covers regression from first principles.Statistics Made Simple Complete Bundle — Textbook + 1,569 Practice Questions
Get it for $16
E

The EconTutorials team writes clear, exam-focused lessons in economics and statistics for A-Level, IB, AP and university students, with more than 13 years of classroom teaching behind every guide and book in the Made Simple series.