*! version 1.0.2 06mar2026

Title

xtpqroot -- Panel Quantile Unit Root Tests with Common Shocks & Structural Breaks

Syntax

CIPS(tau) Test (Yang, Wei & Cai 2022; Nazlioglu et al. 2026):

xtpqroot varname [if] [in],
[quantile(numlist)
model(string)
maxlag(#)
reps(#)
nograph
notable
level(#)
cdtest
individual]

tFR Test (Corakci & Omay 2023):

xtpqroot varname [if] [in],
fourier
[model(string)
maxlag(#)
bootreps(#)
nograph
notable
level(#)]

Panel data must be declared using xtset. The panel must be strongly balanced
(no gaps or missing observations).

Description

xtpqroot implements two novel panel unit root tests designed for panel data
with cross-sectional dependence (CSD):

1. CIPS(tau) Test: Quantile panel unit root test with common shocks, proposed by
Yang, Wei & Cai (2022, Economics Letters). It extends Pesaran's (2007) CIPS test
to a quantile regression framework, allowing the analysis of asymmetric persistence
across different quantiles of the conditional distribution. While the standard CIPS
test assesses the mean persistence, CIPS(tau) can detect, for example, whether a series
is more persistent in extreme quantiles than in the center. Implementation follows
Nazlioglu, Tarakci, Karul & Erdem (2026, NAJEF).

2. tFR Test: Panel unit root test with smooth and sharp structural breaks,
proposed by Corakci & Omay (2023, Renewable Energy). It combines the fractional
Fourier function (for smooth, gradual breaks) with the logistic smooth transition (LST)
function (for sharp, abrupt breaks). This allows the test to capture both types of
structural change simultaneously. Cross-sectional dependence is corrected via the
sieve bootstrap procedure of Chang (2004).

Options

Common Options

model(string) specifies the deterministic component of the regression.

For CIPS(tau): intercept (default) includes only a constant;
trend adds a linear time trend.

For tFR: intercept estimates Model A (intercept shift only);
trend estimates Model B (intercept shift + linear trend);
trendshift estimates Model C (both intercept and trend shift). The choice
of model should match the data generating process: use intercept for level
shifts, trend if the series has a trend, and trendshift if you suspect
both the level and trend slope may change.

maxlag(#) specifies the maximum lag order for augmented regressions. The
default is automatic: p = floor[4(T/100)^{1/4}], following Schwert (1989)
and Pesaran (2007). For the Fourier test, the maximum is capped at 6 and the
optimal lag within each panel is selected by the Schwarz information criterion (SIC).

nograph suppresses all graphical output.

notable suppresses all tabular output.

level(#) sets the confidence level for inference. Default is 95.

CIPS(tau) Options

quantile(numlist) specifies the quantile(s) at which to run the CIPS(tau) test.
Values must be strictly between 0 and 1. Default: 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9.

reps(#) specifies the number of Monte Carlo replications used to simulate
the empirical distribution of CIPS and CIPS(tau) under H0 (unit root in all panels).
Default is 1000. Larger values improve p-value precision but increase computation
time. For preliminary work, reps(200) is often sufficient.

cdtest additionally reports the Pesaran (2004, 2021) CD test for cross-sectional
dependence, computed from both OLS and quantile regression residuals. Significant CD
statistics suggest that cross-sectional dependence is present and that standard panel
unit root tests (e.g., IPS, LLC) may be oversized.

individual displays the individual panel-level CADF and CADF(tau) test statistics,
along with panel-specific p-values from the Monte Carlo simulation. This is useful to
identify which specific panels reject the unit root hypothesis.

tFR Options

fourier selects the Corakci & Omay (2023) tFR test rather than the CIPS(tau) test.
Cannot be combined with quantile().

bootreps(#) specifies the number of sieve bootstrap replications for computing
bootstrap p-values and critical values. Default is 2000. Larger values improve the
precision of the bootstrap distribution.

Output Description

CIPS(tau) Output

The CIPS(tau) output consists of the following sections:

Data Summary: Displays the variable name, panel structure (panel/time variables,
N panels, T time periods, total observations), deterministic specification
(Intercept only or Intercept + Trend), lag order, MC replications, and
truncation constants (K1, K2) used for the Pesaran (2007) truncation procedure.

Panel Unit Root Tests: Reports the standard OLS-based CIPS statistic (Pesaran 2007)
with its Monte Carlo p-value. This provides a baseline for comparison.

CIPS(tau) (Quantile Panel Unit Root): Reports the quantile-specific CIPS(tau)
statistic, p-value, significance stars, and rejection decision at each requested
quantile tau. More negative CIPS(tau) values indicate stronger evidence against
the null.

Cross-Sectional Dependence Tests (with cdtest): Reports the Pesaran (2021)
CD statistic and p-value from OLS residuals, followed by CD(tau) at each quantile
from quantile regression residuals.

Hypotheses: States the null and alternative hypotheses and provides guidance
on interpreting asymmetric persistence patterns.

Individual Panel Results (with individual): Displays rho(OLS) and
rho(tau) for each panel, with significance stars based on individual CADF
p-values from the MC simulation. A summary line shows the number of panels
rejecting H0 at each quantile.

Footer: Significance levels are denoted as *** p<0.01, ** p<0.05, * p<0.10.
Source references: Yang, Wei & Cai (2022, Econ. Letters);
Nazlioglu et al. (2026, NAJEF).

Graphs: Two publication-quality graphs are produced by default:
(1) CIPS(tau) statistic plotted across quantiles, and
(2) Persistence degree rho(tau) across quantiles with confidence bands
(mean across panels with 10%-90% range).

tFR Output

The tFR output consists of the following sections:

Data Summary: Displays the variable name, panel structure, model type
(A: Intercept shift, B: Intercept shift + Trend, C: Intercept + Trend shift),
CSD correction method (Sieve Bootstrap), bootstrap replications, maximum ADF
lag, and lag selection criterion (SIC).

Panel Test Result: Reports the tFR panel statistic (cross-sectional average
of individual Fourier ADF t-statistics), bootstrap p-value, and significance
stars.

Bootstrap Critical Values: Reports critical values at the 1%, 5%, and 10%
significance levels from the sieve bootstrap, along with the tFR statistic and
a decision column indicating Reject H0 or Fail to reject H0 at each level.

Individual Panel Results: For each panel, displays:

t_i,fr - the Fourier ADF t-statistic for panel i

k^fr - the optimal fractional Fourier frequency (controls break shape)

gamma - the LST transition speed (large = sharp, small = gradual)

tau - the estimated break location (fraction of sample)

Break Date - the estimated calendar date of the structural break

SIC p - the optimal ADF lag selected by the Schwarz criterion

Significance stars (* ** ***) compare individual t_i,fr to bootstrap CVs.

Sharp and Smooth Break Dates: A summary table (matching Table 6 in
Corakci & Omay 2023) listing each panel's sharp break date (from the LST logistic
function threshold) and smooth break dates (from the Fourier function turning
points).

Hypotheses: States the null (H0: all panels contain a unit root) and
alternative (H1: some panels are stationary).

Footer: Significance levels *** p<0.01, ** p<0.05, * p<0.10.
Source reference: Corakci & Omay (2023, Renewable Energy).

Graphs: Two publication-quality graphs are produced by default:
(1) Actual vs. fitted (LST + Fourier) curves for each panel as small multiples, and
(2) Individual t(i,FR) statistics as a bar chart with bootstrap 5% critical value
line and color-coded significance.

Interpretation Guide

CIPS(tau) Test

Hypotheses:

H0: rho_i(tau) = 1 for all panels i and all quantiles tau -
all panels contain a unit root.

H1: rho_i(tau) < 1 for some panels i -
some panels are stationary (at the given quantile).

Reading the output table: The CIPS(tau) statistic is the cross-sectional average
of individual CADF(tau) t-statistics. More negative values indicate stronger evidence
against the null of a unit root. The p-values are obtained from Monte Carlo simulation
under the null hypothesis.

Significance stars: *** p<0.01, ** p<0.05, * p<0.10. Stars appear next to
p-values and individual rho estimates to indicate rejection of H0 at the
corresponding significance level.

Asymmetric persistence patterns:

Reject at low tau but not high tau: The variable is mean-reverting during
normal/low periods but persistent during extreme positive shocks (e.g., high
inflation episodes are persistent, but low inflation reverts to mean).

Reject at high tau but not low tau: The opposite asymmetry; the variable
is persistent during contractionary episodes.

Reject across all tau: Strong evidence of overall stationarity. The unit
root can be rejected uniformly across the distribution.

Fail to reject at all tau: Consistent with a unit root across the entire
distribution.

Persistence graph: The rho(tau) graph plots the autoregressive coefficient at
each quantile. Values of rho(tau) >= 1 indicate a unit root (persistence) at that
quantile, while rho(tau) < 1 indicates mean-reversion. The graph provides a visual
summary of asymmetric persistence across the distribution.

tFR Test

Hypotheses:

H0: phi_i = 0 for all panels i - all panels contain a unit root.

H1: phi_i < 0 for some panels i - some panels are stationary.

Reading the output: The tFR statistic is the cross-sectional average of individual
Fourier ADF t-statistics. The bootstrap p-value and critical values are derived from the
sieve bootstrap. Reject the null if tFR is less than the bootstrap critical value at
the chosen significance level, or equivalently, if the bootstrap p-value is below the
chosen alpha.

Individual panel statistics: Large negative t_i,fr values indicate stronger
evidence of stationarity for that panel. Stars indicate significance relative to
the bootstrap critical values. The gamma parameter controls the sharpness of the
LST break: gamma > 10 indicates a sharp, abrupt structural break; gamma < 1
indicates a gradual transition. The tau parameter (0 to 1) locates the break
within the sample period.

Break dates table: Sharp break dates correspond to the estimated location
of the logistic smooth transition function. Smooth break dates are the turning
points (peaks and troughs) of the estimated Fourier function. Panels with
very low k^fr (e.g., k < 0.2) may show no smooth break dates within the sample.

Notes and Warnings

Data Requirements

Balanced panel required. The panel must be strongly balanced - each panel
unit must have the same number of time periods with no gaps. Use xtdescribe to
verify the panel structure before running xtpqroot.

Minimum dimensions. The test requires at least N >= 3 panels and T >= 15 time
periods. Very small T (below 20) may produce unreliable results. The test is designed
for panels where both N and T are reasonably large.

Computation Time

CIPS(tau) test: Computation time grows with N * nq * reps, where nq is the
number of quantiles. For large panels (N > 100), reps(100) may take several
minutes. Use reps(200) for preliminary work and increase to reps(1000)
or more for final published results.

tFR test: The Fourier grid search (Step 1-2) and sieve bootstrap (Step 3) are
both computationally intensive. The grid search uses Mata-compiled matrix algebra
for speed. Use bootreps(500) for preliminary work.

Graphs: When graphs are enabled (the default), the CIPS(tau) test computes
rho(tau) at 99 quantile points per panel. For very large N, use nograph to
save time during preliminary analysis, then re-run with graphs for final
results.

Methodology Notes

Cross-sectional dependence: The CIPS(tau) test handles CSD by including
cross-sectional averages (ybar, Dybar) as auxiliary regressors in the CADF regression,
following Pesaran (2007). The tFR test handles CSD via the sieve bootstrap, which
preserves the cross-panel correlation structure by resampling full time-period rows
of centered residuals.

Truncation: Following Pesaran (2007, p.35), individual CADF statistics are
truncated at [-K1, K2] before averaging. This ensures that the CIPS statistic has
finite moments even when some individual panel statistics are extreme. The truncation
constants are K1=6.19 for both models and K2=2.16 (intercept) or K2=2.61 (trend).
Un-truncated statistics are used for individual panel p-value calculations.

Sparsity estimation: The standard error of the quantile autoregressive coefficient
uses the Koenker & Xiao (2004) bandwidth for kernel density estimation at the residual
quantiles. This avoids the VCE failures that occur with Stata's built-in qreg
at extreme quantiles.

Fourier frequency: The tFR test searches over fractional frequencies
k^fr in [0.1, 5.0] (step size 0.1), selecting the value that minimizes the sum of
squared residuals. Unlike integer Fourier tests, fractional frequencies provide a
more flexible representation of smooth structural change.

LST transition function: The logistic smooth transition function
F(t) = 1/(1 + exp(-gamma*(t/T - tau))) captures sharp structural breaks. The
parameter gamma controls the speed of transition (gamma -> infinity yields a
step function), and tau in (0,1) determines the break location. The grid search
evaluates gamma in {0.1, 0.5, 1, 3, 5, 10, 30, 50} and tau in [0.15, 0.85]
(step 0.05).

Examples

The examples below use the Grunfeld (1958) investment data, a classic balanced
panel dataset (N=10 firms, T=20 years) available via webuse grunfeld.

Setup

. webuse grunfeld, clear

. xtset company year

. xtdescribe

CIPS(tau) Test

Example 1: CIPS(tau) with default quantiles (intercept model)

. xtpqroot invest, model(intercept) maxlag(2) reps(1000)

This runs the quantile panel unit root test at the default 9 quantiles
(0.1, 0.2, ..., 0.9) with an intercept-only model. The test reports both
the standard CIPS statistic and CIPS(tau) at each quantile, with Monte
Carlo p-values from 1000 replications. Output includes:

- Data Summary with variable info, panel dimensions, and truncation constants

- Panel Unit Root Tests table with CIPS statistic and p-value

- CIPS(tau) table with statistic, p-value, significance stars, and decision

- Hypotheses and interpretation guide

- Footer: *** p<0.01, ** p<0.05, * p<0.10

- Source: Yang, Wei & Cai (2022, Econ. Letters); Nazlioglu et al. (2026, NAJEF)

- Two combined graphs (CIPS(tau) across quantiles + rho(tau) persistence)

Example 2: CIPS(tau) at specific quantiles with CD test and individual results

. xtpqroot invest, quantile(0.1 0.5 0.9) model(intercept) maxlag(2) reps(1000) cdtest individual

Tests at the 10th, 50th, and 90th percentiles only. The cdtest
option adds the Pesaran (2021) CD test for cross-sectional dependence
(both OLS-based CD and quantile-based CD(tau) at each quantile).
The individual option displays panel-specific autoregressive
coefficients rho and their significance, allowing identification of
which firms reject the unit root. A summary line shows how many panels
reject out of N at each quantile.

Example 3: CIPS(tau) with trend model

. xtpqroot invest, quantile(0.1 0.3 0.5 0.7 0.9) model(trend) maxlag(2) reps(1000)

Includes a linear trend in the CADF regression. Use this specification
when the series exhibits trending behavior. The truncation constant K2
changes from 2.16 (intercept) to 2.61 (trend).

Example 4: Suppress graphs for speed

. xtpqroot invest, model(intercept) reps(200) nograph

tFR Test (Fourier + Sharp Breaks)

Example 5: tFR test -- intercept shift (Model A)

. xtpqroot invest, fourier model(intercept) maxlag(2) bootreps(2000)

Tests for a unit root allowing for both smooth (Fourier) and sharp (LST)
structural breaks in the intercept. Output includes:

- Data Summary with model type, CSD correction, bootstrap replications

- Panel Test Result with tFR statistic, bootstrap p-value, and stars

- Bootstrap Critical Values table (1%, 5%, 10%) with reject/fail decision

- Individual Panel Results (t_i,fr, k^fr, gamma, tau, Break Date, SIC p)

- Sharp and Smooth Break Dates table (Table 6 format)

- Notes explaining how break dates are determined

- Hypotheses

- Footer: *** p<0.01, ** p<0.05, * p<0.10

- Source: Corakci & Omay (2023, Renewable Energy)

- Two graphs (panel fitted curves + t-statistic bar chart)

Example 6: tFR test -- trend model (Model B)

. xtpqroot invest, fourier model(trend) maxlag(2) bootreps(2000)

Adds a linear trend to the break model. Appropriate when the series
has a deterministic trend component.

Example 7: tFR test -- intercept + trend shift (Model C)

. xtpqroot invest, fourier model(trendshift) maxlag(2) bootreps(2000)

The most general model, allowing both the intercept and trend slope
to shift at the break point. Use when you suspect the trend growth rate
itself may have changed.

Complete test suite

Example 8: Running all tests on the same dataset

. webuse grunfeld, clear

. xtset company year

. set seed 2026

* CIPS(tau) -- default quantiles

. xtpqroot invest, model(intercept) maxlag(2) reps(1000)

* CIPS(tau) -- 3 quantiles + CD test + individual

. xtpqroot invest, quantile(0.1 0.5 0.9) model(intercept) maxlag(2) reps(1000) cdtest individual

* CIPS(tau) -- trend model

. xtpqroot invest, quantile(0.1 0.3 0.5 0.7 0.9) model(trend) maxlag(2) reps(1000)

* Fourier -- all three models

. xtpqroot invest, fourier model(intercept) maxlag(2) bootreps(2000)

. xtpqroot invest, fourier model(trend) maxlag(2) bootreps(2000)

. xtpqroot invest, fourier model(trendshift) maxlag(2) bootreps(2000)

Stored results

xtpqroot stores the following in r():

Common scalars:

r(N_panels) number of cross-sectional units (N)

r(T_periods) number of time periods (T)

Common macros:

r(cmd) "xtpqroot"

r(varname) name of the tested variable

r(panelvar) panel variable

r(timevar) time variable

r(model) "intercept", "trend", or "trendshift"

CIPS(tau) scalars:

r(cips) CIPS statistic (OLS-based, Pesaran 2007)

r(cips_p) Monte Carlo p-value for CIPS

r(cipstau_XX) CIPS(tau) statistic at quantile 0.XX

r(pval_XX) Monte Carlo p-value at quantile 0.XX

r(maxlag) lag order used

r(reps) number of MC replications

CIPS(tau) matrices:

r(cipstau) (nq x 3) matrix: tau, CIPS(tau) statistic, p-value

CIPS(tau) macros:

r(test) "CIPStau"

tFR scalars:

r(tfr) tFR panel statistic

r(pvalue) sieve bootstrap p-value

r(cv01) 1% bootstrap critical value

r(cv05) 5% bootstrap critical value

r(cv10) 10% bootstrap critical value

r(bootreps) number of bootstrap replications

tFR matrices:

r(ind_results) (N x 7) matrix of individual results:

Columns: t_i,fr | k^fr | gamma | tau | break_date | phi | SIC_lag

tFR macros:

r(test) "tFR"

r(model_type) model label (A, B, or C)

References

Chang, Y. (2004). Bootstrap unit root tests in panels with cross-sectional dependency.
Journal of Econometrics 120, 263-293.

Corakci, A. and Omay, T. (2023). Is there convergence in renewable energy deployment?
Evidence from a new panel unit root test with smooth and sharp structural breaks.
Renewable Energy 205, 648-662.

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

Nazlioglu, S., Tarakci, D., Karul, C., and Erdem, U. (2026). Inflation shocks:
quantile unit root inference for panel data with cross-correlations. North American
Journal of Economics and Finance 83, 102592.

Pesaran, M.H. (2007). A simple panel unit root test in the presence of cross-section
dependence. Journal of Applied Econometrics 22, 265-312.

Yang, Z., Wei, Z., and Cai, Y. (2022). Quantile unit root inference for panel data
with common shocks. Economics Letters 219, 110809.

Authors

Dr. Merwan Roudane

Email: merwanroudane920@gmail.com

Please cite the original methodological papers when using this command.

Also see

Online: xtunitroot, xtset, qreg