ADF Stationarity Test
A method that tests whether a time series has a unit root, to judge whether it is nonstationary and needs differencing.
Suppose a graph of monthly sales keeps climbing. If the graph shows autocorrelation, is that because sales are influenced by last month? Or is it because the level itself shifts over time?
In a time series, a simple upward trend and persistent random change often appear mixed together. Before applying ordinary regression or an ARIMA model to such data, you often need to check the properties of the series.
The ADF test (Augmented Dickey–Fuller test) tests whether a time series has a unit root. Having a unit root means the effect of a shock lasts a long time, so the series is likely to behave differently from an ordinary stationary series.
In this guide we use a hypothetical monthly sales index to compare the original series with its first-differenced series, and look at how to read the ADF statistic, the p-value and the critical values, as well as the test's limitations.
What is the ADF test?
It checks statistically whether a time series has a unit root.
The ADF test is a unit root test that extends the Dickey–Fuller test so that it can include additional lagged difference terms of the series. It examines whether the current series has a unit root while accounting for autocorrelation across several time points.
The null hypothesis (H₀) of the ADF test is that a unit root exists. The alternative hypothesis (H₁) is that, given the specified deterministic terms (constant, trend, etc.), the process has no unit root. Rejecting the null hypothesis does not automatically prove stationarity in every sense.
Why do we need to check stationarity?
Data whose level keeps moving can distort relationships and forecasts.
In data whose mean and variability structure change over time, simple correlations can be exaggerated, or the model's residual structure may not be properly explained. For example, regressing two unrelated rising series on each other can produce a spurious regression that looks like a significant relationship.
A unit root test is not the only way to judge stationarity. You should look at it together with the graph, seasonality, structural changes and the results of other tests. Still, it is a useful starting point for considering whether differencing is needed.
How does the ADF test work?
It explains the change using the previous level and lagged difference terms.
Here γ = 0 corresponds to the unit root null hypothesis. Whether to include the constant α, the time trend βt and the lagged difference terms is decided to suit the data.
The test statistic is a t-type statistic for γ, but it follows the Dickey–Fuller distribution rather than the usual t distribution. So you must not judge it using ordinary t-test critical values.
With too few lagged difference terms, residual autocorrelation remains; with too many, power can drop. In this example we include a constant and choose the number of lags by AIC.
Real-world example: a monthly sales index over 120 months
We compare the original series and the first-differenced series under the same conditions.
We look at a monthly sales index recorded by a retail company over 10 years. This hypothetical data was generated so that a small upward pressure and irregular shocks accumulate each month. It is not any real company's sales data.
| Item | Setting |
|---|---|
| Observation period | 120 consecutive hypothetical months |
| Original series | Monthly sales index with cumulative change |
| Comparison series | First difference (this month − last month) |
| ADF deterministic terms | Constant included (regression = c) |
| Lag selection | Automatic selection by AIC |
| Significance level | 5% |
What does the graph of the original series show?
A visible rise is not evidence of stationarity.
In the original series the values shift over time, and changes caused by shocks remain in later levels too. This pattern fits a series with a unit root well, but you should not conclude there is a unit root from the graph alone.
How do you read the numbers in the ADF results table?
Check the test statistic, the p-value and the critical values together.
| Measure | ADF result, original series |
|---|---|
| ADF test statistic | -0.148 |
| p-value | 0.9445 |
| Number of difference lags used | 0 |
| Number of observations used in the test | 119 |
| 5% critical value | -2.886 |
For the original series, the ADF statistic is -0.148 and the p-value is 0.944. At the 5% significance level we fail to reject the null hypothesis. Therefore, there is not enough evidence to conclude that there is no unit root. This is different from proving that a unit root definitely exists.
When the test statistic is more negative than the corresponding critical value, the result points toward rejecting the null hypothesis. In an actual decision, you need to check the chosen model specification together with the p-value and the critical values.
What changes after first differencing?
We analyze the change between time points instead of the level.
The first difference is calculated by subtracting last month's value from this month's value. It removes the accumulated changes in level, letting you look at the data in terms of each month's change. However, not every nonstationary series is fixed by first differencing alone.
| Measure | ADF result, first difference |
|---|---|
| ADF test statistic | -4.494 |
| p-value | 0.0002018 |
| Number of difference lags used | 4 |
| Number of observations used in the test | 114 |
| 5% critical value | -2.887 |
For the differenced series, the ADF statistic is -4.494 and the p-value is 0.0002018. At the 5% level we reject the unit root null hypothesis. In this hypothetical case, we can interpret the differenced series as behaving more like a stationary series than the original series.
How do you choose the constant and trend terms?
The null hypothesis and critical values change depending on the deterministic terms you choose.
| Setting | Terms included | When to consider |
|---|---|---|
| No constant (n) | None | When the process plausibly has a mean close to 0 |
| Constant (c) | Constant | When allowing for a nonzero mean or a drift |
| Constant + trend (ct) | Constant · linear time trend | When there may be a deterministic linear trend |
You should not automatically add or drop a trend term just because a trend looks clear. Decide based on the context in which the data were generated, the graph and the model assumptions. When you change the specification, the interpretation of the test changes as well.
How does it differ from other time series diagnostics?
Unit root tests, stationarity tests and residual tests ask different questions.
| Method | Main question | Null hypothesis |
|---|---|---|
| ADF | Is there a unit root? | A unit root exists |
| KPSS | Is it stationary around a level or a trend? | Stationarity |
| Ljung–Box | Does autocorrelation remain up to the specified lag? | Those autocorrelations are 0 |
| ARCH-LM | Is there a conditional heteroskedasticity effect? | No ARCH effect |
| ACF/PACF | What is the autocorrelation structure like? | Not itself a test of a single null hypothesis |
ADF and KPSS have null hypotheses pointing in opposite directions, so they can be used to complement each other. Passing the ADF test does not mean the autocorrelation problem checked by Ljung–Box is solved as well.
What should you check before the analysis?
Check the observation interval, missing values, seasonality and structural changes first.
Time interval and missing values
For monthly data, consecutive months must all be present. Filling missing values with 0 without any justification, or analyzing irregular dates just by their order, can distort the interpretation of differences and lags.
Seasonality and structural changes
Seasonal unit roots, economic shocks and structural breaks due to policy changes can shake the results of an ordinary ADF test. If needed, consider seasonal differencing or a separate test that is robust to structural change.
Lag length and sample size
The number of lags can be chosen with AIC, BIC and the like, but with a small sample the power can be low. You should also check whether residual autocorrelation remains.
Points to watch when interpreting ADF results
Do not read a failure to reject the null hypothesis as proof of a unit root.
It is hard to conclude “the series is nonstationary” just because the p-value is .05 or higher. It means there is not enough evidence to reject a unit root, and it may have come out that way because of low power or the model specification.
Conversely, even if the p-value is smaller than .05, that does not guarantee constant variance, seasonal stability or the absence of structural change. Over-differencing can lose useful long-run relationships, so consider visual diagnostics and context together.
Reporting ADF test results in words
Write up the test settings and results for the original and differenced series separately.
In the report, state the unit and observation period of the data, whether a constant and trend were included, how the lags were selected, the ADF statistic and p-value, and whether differencing was applied.
An ADF test including a constant was conducted on 120 values of a hypothetical monthly sales index, with the number of difference lags selected by AIC. For the original series, the unit root null hypothesis was not rejected (ADF = -0.15, p = 0.944). For the first-differenced series, however, the null hypothesis was rejected (ADF = -4.49, p < .001). These results show that, in this example, the evidence for treating the series as having no unit root was strengthened after first differencing.
Where can the ADF test be used?
It checks the basic properties of a time series before modeling.
| Field | Question to examine | Follow-up analysis |
|---|---|---|
| Economics | Is the level of price and production indexes stable? | ARIMA · cointegration review |
| Retail | Does the monthly sales series have a unit root? | Differencing and seasonality diagnostics |
| Finance | Do prices and returns behave differently? | Return modeling |
| Energy | Does monthly demand shift over the long run? | Forecasting after making it stationary |
The ADF test does not itself make forecasts, but it provides the basis for judgments needed to set up many time series models, such as ARIMA and VAR, appropriately. To analyze long-run equilibrium relationships, you also need to separately examine each series' order of integration and whether the series are cointegrated.
The ADF test is a starting point for checking whether a time series has a unit root.
Read not only the test results but also how the data move and how the model is set up.
The ADF test examines whether a time series has a unit root, helping you decide on differencing and model specification. Even if you fail to reject the null hypothesis for the original series, the existence of a unit root has not been proven; conversely, even if you reject it, not every form of stationarity is guaranteed.
Only by looking together at the deterministic terms used in the test, the lag selection method, the graph and the possibility of structural change can you correctly convey what the results mean.
The ADF test tests the null hypothesis that a time series has a unit root. A small p-value gives grounds to reject the unit root null hypothesis, but failing to reject it does not prove a unit root exists. When comparing the original and differenced series, check whether a constant and trend are included, the number of lags, and seasonality and structural changes together.