*! version 1.0.0 February 2026

Title

qadf -- Quantile Autoregression Unit Root Test (Koenker & Xiao, 2004)

Syntax

Single-quantile test

qadf
varname
[if] [in]
[, qadf_options]

Multi-quantile process

qadf_process
varname
[if] [in]
[, process_options]

Bootstrap inference

qadf_boot
varname
[if] [in]
[, boot_options]

Visualization

qadf_graph
[, graph_options]

qadf options

tau(#) quantile; default is tau(0.5)

model(string) model specification; c (constant, default) or ct (constant + trend)

maxlags(#) maximum ADF lags; default is maxlags(8)

ic(string) information criterion; aic (default), bic, or tstat

level(#) confidence level; default is level(95)

noprint suppress output display

qadf_process options

quantiles(numlist) quantiles to evaluate; default is quantiles(0.1 0.2 ... 0.9)

model(string) model specification

maxlags(#) maximum ADF lags

ic(string) information criterion

bootstrap use bootstrap for QKS/QCM critical values

reps(#) bootstrap replications; default is reps(399)

seed(#) random seed for reproducibility

qadf_boot options

tau(#) quantile

model(string) model specification

reps(#) bootstrap replications; default is reps(399)

seed(#) random seed

qadf_graph options

saving(filename) save graph to file

scheme(scheme) graph scheme; default is scheme(s2color)

title(string) custom title

combine combined 4-panel plot (default)

rhoonly coefficient plot only

tstatonly t-statistic plot only

delta2only delta-squared plot only

halflifeonly half-life plot only

You must tsset your data before using qadf; see [TS] tsset.

varname may contain time-series operators; see tsvarlist.

Description

qadf performs the Quantile Autoregression (QAR) unit root test proposed by
Koenker and Xiao (2004). This test provides a more robust approach to testing
the unit root hypothesis compared to conventional ADF and Phillips-Perron tests,
especially for data with non-Gaussian disturbances (heavy-tailed distributions).

Key features:

1. Robustness: Superior power under non-Gaussian conditions
(heavy-tailed distributions) compared to standard unit root tests.

2. Asymmetric dynamics: The quantile approach reveals how persistence
varies across quantiles, capturing asymmetric adjustment behavior. For example,
a series might be mean-reverting after negative shocks (low quantiles) but
explosive after positive shocks (high quantiles).

3. Multiple test procedures: Individual quantile tests t_n(tau),
coefficient-based tests U_n(tau), and global Kolmogorov-Smirnov (QKS) and
Cramer-von Mises (QCM) tests across all quantiles.

4. Flexible inference: Hansen (1995) tabulated critical values
(indexed by delta-squared) and optional bootstrap critical values.

The commands are organized as follows:

qadf performs the test at a single quantile.

qadf_process performs the test across multiple quantiles and
computes global QKS and QCM statistics.

qadf_boot computes bootstrap p-values and critical values.

qadf_graph creates publication-quality plots from qadf_process
results.

Options

Model

tau(#) specifies the quantile at which to perform the QAR unit root
test. The value must be strictly between 0 and 1. Common choices include
0.5 (median), 0.25, and 0.75. The default is tau(0.5).

model(string) specifies the deterministic component in the QAR model:

c (the default) includes a constant (intercept) only:

Q_(tau|F_) = alpha_0(tau) + alpha_1 * y_ + sum[alpha_ * dy_] + u_t

ct includes both a constant and a linear time trend:

Q_(tau|F_) = alpha_0(tau) + alpha_1 * y_ + beta * t + sum[alpha_ * dy_] + u_t

maxlags(#) specifies the maximum number of lagged first differences
to include in the ADF regression. The optimal lag is selected according
to the chosen information criterion. The default is maxlags(8).

ic(string) specifies the lag selection method:

aic (the default) uses the Akaike Information Criterion.

bic uses the Bayesian (Schwarz) Information Criterion.

tstat uses the t-statistic significance rule: starts at the
maximum lag and reduces until the last lag coefficient is significant at 5%.

Bootstrap

bootstrap (in qadf_process) requests that bootstrap critical
values be computed for the QKS and QCM global statistics. This follows
the resampling procedure in Section 3.2 of Koenker and Xiao (2004).

reps(#) specifies the number of bootstrap replications. The default
is reps(399). Higher values produce more precise p-values but
require more computation time.

seed(#) sets the random number seed for reproducibility.

Interpreting results

Single-quantile output (qadf)

rho_1(tau) [QR]: The quantile autoregressive coefficient at quantile tau.
If rho_1(tau) < 1 the series is mean-reverting at that quantile;
if rho_1(tau) >= 1 it behaves like a unit root or is explosive.

rho_1 [OLS]: The standard OLS estimate of the autoregressive coefficient.
This is the conventional ADF estimate and does not vary across quantiles.

alpha_0(tau): The quantile-specific intercept. This captures the
location shift of the conditional distribution at each quantile.

delta-sq: The estimated nuisance parameter delta^2, which measures the
long-run correlation between the first differences and quantile indicator.
It indexes the critical values from Hansen (1995). Values near 0 yield
critical values close to the standard normal; values near 1 yield critical
values close to the Dickey-Fuller distribution.

Half-life: The number of periods needed for a shock to decay by 50%,
computed as ln(0.5)/ln(rho_1(tau)). Only meaningful when rho_1(tau) < 1
(stationary quantile). Displayed as "---" when rho_1(tau) >= 1.

t_n(tau): The quantile unit root t-statistic (Equation 9 in the paper).
This is a left-tail test. Reject H0 (unit root) when t_n(tau) is
sufficiently negative (i.e., below the critical value).

U_n(tau) = n(rho-1): The coefficient-based test statistic. Large negative
values indicate stationarity. This is analogous to the Dickey-Fuller
normalized bias statistic.

Critical values: From Hansen (1995), indexed by delta-sq. The test is
one-sided (left-tail):

- Reject H0 at 1% if t_n(tau) < CV(1%)

- Reject H0 at 5% if t_n(tau) < CV(5%)

- Reject H0 at 10% if t_n(tau) < CV(10%)

Significance levels are marked as *** (1%), ** (5%), * (10%).

Multi-quantile output (qadf_process)

The process table reports rho_1(tau), t_n(tau), U_n(tau), delta-sq, and
critical values at 1%, 5%, and 10% for each quantile. This allows you to
see how persistence varies across the conditional distribution.

Typical interpretation patterns:

(a) Unit root at all quantiles: rho_1(tau) near 1 everywhere, no
rejections. The series has a unit root across the entire distribution.

(b) Stationary at all quantiles: rho_1(tau) < 1 everywhere, with
significant t_n(tau) at most quantiles. The series is globally stationary.

(c) Asymmetric persistence: rho_1(tau) < 1 at some quantiles but
>= 1 at others. For example, stationary at low quantiles (negative shocks
die out) but explosive at high quantiles (positive shocks persist). This is
the key advantage of the QADF test over standard ADF.

Global statistics (QKS and QCM)

QKS (Kolmogorov-Smirnov type): Tests whether the coefficient equals 1
at any quantile. QKS = sup|t_n(tau)|. Reject if QKS exceeds the
bootstrap critical value (right-tail test). Sensitive to deviations at
individual quantiles.

QCM (Cramer-von Mises type): Tests whether the coefficient equals 1
across all quantiles on average. QCM = int t_n(tau)^2 dtau. Reject if
QCM exceeds the bootstrap critical value (right-tail test). More powerful
when deviations from unity are spread across many quantiles.

Note: QKS and QCM have non-standard distributions. Use the bootstrap
option in qadf_process to obtain data-specific critical values for
these statistics.

Bootstrap output (qadf_boot)

Bootstrap p-value: The proportion of bootstrap t-statistics that are
more extreme (more negative) than the observed t_n(tau). A small p-value
(< 0.05) indicates rejection of the unit root null, providing finite-sample
inference that does not rely on asymptotic critical values.

Bootstrap critical values: Data-specific critical values at 1%, 5%,
and 10% significance levels, obtained from the empirical distribution of
bootstrap t-statistics under H0 (unit root).

Examples

Setup

. webuse lutkepohl2

. tsset qtr

Basic QADF test at median

. qadf inv, tau(0.5)

QADF test at lower quartile with trend

. qadf inv, tau(0.25) model(ct)

Multi-quantile process (9 quantiles, default)

. qadf_process inv

Multi-quantile process with bootstrap QKS/QCM critical values

. qadf_process inv, bootstrap reps(499) seed(12345)

Custom quantiles and BIC lag selection

. qadf_process inv, quantiles(0.1 0.25 0.5 0.75 0.9) ic(bic)

Bootstrap inference at a single quantile

. qadf_boot inv, tau(0.5) reps(999) seed(42)

Visualization (after qadf_process)

. qadf_process inv

. qadf_graph

Save graph to file

. qadf_graph, saving(qadf_results.png)

Individual coefficient plot only

. qadf_graph, rhoonly

Stored results

qadf stores the following in r():

Scalars

r(N) number of observations

r(tau) quantile

r(lags) optimal lag length

r(qadf) QADF t-statistic t_n(tau)

r(Unstat) coefficient statistic U_n(tau) = n(alpha_1 - 1)

r(rho_tau) QR estimate of alpha_1(tau)

r(rho_ols) OLS estimate of alpha_1

r(alpha_tau) QR estimate of alpha_0(tau)

r(delta2) estimated delta-squared

r(half_life) shock half-life

r(cv1) 1% critical value (Hansen 1995)

r(cv5) 5% critical value (Hansen 1995)

r(cv10) 10% critical value (Hansen 1995)

Macros

r(varname) name of variable

r(model) model specification

r(ic) information criterion

r(cmd) qadf

qadf_process additionally stores:

Scalars

r(QKS_alpha) QKS statistic based on U_n

r(QKS_t) QKS statistic based on t_n

r(QCM_alpha) QCM statistic based on U_n

r(QCM_t) QCM statistic based on t_n

Matrices

r(results) matrix of results (tau, rho, tstat, Ustat, delta2, cv1, cv5, cv10, halflife)

qadf_boot additionally stores:

Scalars

r(boot_pvalue) bootstrap p-value

r(boot_cv1_t) 1% bootstrap CV for t_n

r(boot_cv5_t) 5% bootstrap CV for t_n

r(boot_cv10_t) 10% bootstrap CV for t_n

r(boot_nvalid) valid bootstrap replications

Methods and formulas

Consider the pth-order quantile autoregression model (equation 7 of the paper):

Q_(tau | F_) = alpha_0(tau) + alpha_1 * y_ + sum_^ alpha_ * dy_

where alpha_0(tau) = Q_u(tau) is the tau-th quantile of the innovation, and alpha_1 is
the autoregressive coefficient. Under H0: alpha_1 = 1, y_t contains a unit root.

t-statistic (equation 9):

t_n(tau) = [f_hat(F^{-1}(tau)) / sqrt(tau(1-tau))] * sqrt(Y'_{-1} * PX * Y_{-1}) * (alpha_1_hat(tau) - 1)

where f_hat is the estimated quantile density function, Y_{-1} is the vector of
lagged levels, and PX is the projection matrix onto the space orthogonal to
X = (1, dy_, ..., dy_).

Limiting distribution (equation 10):

t_n(tau) => delta * DF + sqrt(1 - delta^2) * N(0,1)

where DF = [int W1^2]^{-1/2} * int W1 dW1 is the Dickey-Fuller distribution,
and delta = sigma_(tau) / (sigma_w * sqrt(tau(1-tau))) is the long-run
correlation between the first differences w_t = dy_t and psi_tau(u_).

Delta-squared estimation: The nuisance parameter delta^2 is estimated as
delta_hat^2 = Cov(w, phi)^2 / (Var(w) * tau * (1-tau)), where phi_t = tau - I(u_hat_t < 0).
This follows the GAUSS implementation approach.

Critical values: Critical values for the test are taken from Hansen (1995,
Table II) and are indexed by delta^2. Linear interpolation is used between
tabulated values.

Global statistics (equations 13-14):

QKS_t = sup_ |t_n(tau)|, QCM_t = int_ t_n(tau)^2 dtau

Bootstrap procedure (Section 3.2):

Step 1: Fit AR(q) to w_t = dy_t by OLS.

Step 2: Draw iid from centered residuals.

Step 3: Generate y*_t = y*_ + w*_t under H0 (unit root).

Step 4: Estimate QAR regression on bootstrap sample.

References

Bofinger, E. 1975. Estimation of a density function using order statistics.
Australian Journal of Statistics 17: 1-7.

Hall, P., and S.J. Sheather. 1988. On the distribution of a studentized
quantile. JRSS-B 50(3): 381-391.

Hansen, B. 1995. Rethinking the univariate approach to unit root tests: How
to use covariates to increase power. Econometric Theory 11: 1148-1171.

Koenker, R., and G. Bassett. 1978. Regression quantiles.
Econometrica 46: 33-49.

Koenker, R., and Z. Xiao. 2004. Unit root quantile autoregression inference.
Journal of the American Statistical Association 99: 775-787.

Siddiqui, M. 1960. Distribution of quantiles from a bivariate population.
Journal of Research of the National Bureau of Standards 64B: 145-150.

Author

Dr. Merwan Roudane

Email: merwanroudane920@gmail.com

GitHub: https://github.com/merwanroudane/quantileadf

Please cite as:

Roudane, M. 2026. QADF: Stata module to perform Quantile ADF unit root tests.

This implementation is based on the methodology in Koenker and Xiao (2004)
and the GAUSS code by Saban Nazlioglu (TSPDLIB package).

Also see

Manual: [TS] dfuller, [TS] pperron

Help: dfuller, pperron, dfgls, kpss (if installed),
punit (if installed)