How this calculation works
The augmented Dickey–Fuller test examines a unit-root null through a lagged-level regression with optional deterministic terms. This calculator fixes the lag count you choose and compares the resulting statistic with finite-sample MacKinnon critical values. It does not apply an ordinary regression t distribution to a unit-root problem.
Delta y_t=gamma y_(t−1)+Σ_j phi_j Delta y_(t−j)+deterministic terms+epsilon_t.A worked example
The prefilled thirty-value series is tested with zero lagged differences and a constant. The regression uses 29 observations. Its lagged-level coefficient divided by its standard error is compared with the one-, five- and ten-percent unit-root critical values for that same deterministic specification.
Good to know
12–300 observations and fixed lags zero through ten, with sufficient residual degrees of freedom. Critical values use MacKinnon 2010 response surfaces for one series. No automatic lag selection, ordinary t p-value, structural-break correction or proof of stationarity from one rejection.
Reference: Statsmodels ADF test and critical values (opens in a new tab) ↗
Deterministic terms belong to the null specification
A constant, a linear trend, or neither defines a different regression specification and a different null distribution. Choose these terms based on the series model rather than whichever option gives rejection. A deterministic trend is not the same as differencing the observations, and adding one changes the interpretation of a stationary alternative.
The regression’s lagged-level coefficient is the central unit-root parameter. Under the null it is zero in the difference equation. A negative estimated coefficient can indicate mean reversion, but the coefficient alone is not a calibrated test statistic; its standard error and the nonstandard unit-root critical values are also required.
The Simple linear regression calculator covers the nearby task. A unit-root test uses a nonstandard null distribution and lagged differences, not an ordinary slope t-test.
Lagged differences address residual dynamics
Lagged differences can absorb short-run dependence in the errors. Each added lag consumes observations and estimated coefficients, so excessive lag counts can leave too little information for the test. This page fixes the user-selected count and rejects an underdetermined or numerically degenerate regression rather than silently reducing the requested model.
There is no automatic AIC or information-criterion lag search in this version. Results from software using automatic selection must be compared after forcing the same lag count and deterministic specification. Otherwise differences can arise from different fitted regressions rather than from a mistake in computing the lagged-level coefficient statistic.
Unit-root critical values are not ordinary t thresholds
The displayed critical values evaluate the MacKinnon finite-sample polynomial response surfaces at the effective regression observation count. Their one-, five- and ten-percent thresholds apply to the chosen specification. Ordinary Student t thresholds are inappropriate here, despite the statistic resembling a coefficient divided by its regression standard error.
Failing to reject does not prove a unit root, and rejecting does not establish that every stationarity assumption is satisfied. Structural breaks, nonlinear dynamics and small samples can affect the interpretation. Independent checks match the exact regression rows and finite-sample critical values before any comparison of test conclusions is made.
Connect the ADF regression to a unit root
The test regresses Δyt on yt−1, selected lagged differences and the chosen deterministic terms. In an AR(1) representation, the lagged-level coefficient γ equals φ−1. The unit-root null φ=1 therefore becomes γ=0, and the statistic is the fitted γ divided by its standard error. Its null distribution is not the ordinary Student t distribution.
Choose no deterministic term, a constant, or a constant plus linear trend to match the underlying hypothesis. Those choices change both the regression and its reference critical values. A trend-stationary alternative is different from a constant-mean stationary alternative, so changing the selector merely to obtain rejection does not preserve the original scientific question.
Read a critical-value comparison without inventing a p-value
Suppose a fitted ADF statistic is −3.20 and the displayed 5% critical value under your selected specification is −2.95. Since −3.20 is more negative, reject the unit-root null at that reference level. If the statistic were −2.70, it would not cross that same threshold. The direction of this comparison is easy to reverse if one treats absolute values as a generic t test.
These numbers illustrate the comparison, not a fixed cutoff for every sample. The page evaluates MacKinnon finite-sample response surfaces using the number of usable regression observations and the deterministic specification. Read the critical values actually displayed for your input. No numerical p-value is returned, so do not infer one by interpolating between the three levels as though the spacing were linear.
Understand how extra lags trade bias against information
Lagged differences absorb short-run serial dynamics so that the regression error is closer to the assumptions of the test. Too few can leave serial correlation; too many consume observations and coefficients, reducing power. This form uses your fixed lag count and does not search an information criterion or perform an automatic residual-diagnostic sequence.
The first difference already loses one observation, and each selected lag loses another initial row. If the original series has n values and k difference lags, the regression uses n−1−k rows. Check that number in the output. A long lag choice on a short series can leave too little information even if the basic input-length requirement was met.
Keep the conclusion narrower than a stationarity certificate
Failure to reject can reflect low power, especially near a unit root; it does not establish that the process truly has one. Rejection under a constant-plus-trend specification supports the corresponding no-unit-root alternative, not necessarily a constant-mean stationary series in levels. Variance changes and other nonstationarity are separate issues.
Structural breaks, seasonal roots and measurement changes can undermine a simple ADF interpretation. Plot the series, consider its sampling process and inspect residual behavior. A complementary test with a different null can be informative, but combining selectively chosen results is not a proof. This calculator supplies a transparent fixed-lag calculation and states its reference convention; it does not choose a complete time-series model for you.
A few questions, answered
Does failing to reject prove a unit root?
No. Failure to reject can also reflect limited power or a misspecified deterministic/lag model.
Are ordinary t critical values used?
No. The page evaluates MacKinnon unit-root critical-value response surfaces.
Should I use a Student t table for the statistic?
No. ADF uses a nonstandard unit-root reference distribution. Compare with the displayed critical values for the chosen deterministic specification.
Why are there fewer regression observations than input values?
Differencing loses one initial value and k lagged differences lose k more rows, leaving n−1−k observations before estimating coefficients.