*! version 1.0.1 08apr2026

Title

xtpqcsplot -- Quantile process plot for panel quantile
regression with common shocks

Syntax

xtpqcsplot depvar indepvars [if] [in],
id(varname)
time(varname)
[options]

Required
id(varname) cross-sectional unit identifier (numeric)

time(varname) time period identifier (numeric)

Quantile grid
quantiles(numlist) grid of quantile indices in (0,1); default 0.10 0.25 0.50 0.75 0.90

Variable selection
variables(varlist) subset of regressors to plot; default = all indepvars

Estimation
bandwidth(#) kernel bandwidth, passed to xtpqcs; default Silverman

kernel(string) gaussian (default), epanechnikov, or uniform

level(#) confidence level for CI bands; default level(95)

Plot appearance
noclassical suppress the classical Kato et al. (blue) CI band

nocombine produce one separate graph per variable (do not combine)

title(string) override the main title on the combined graph

subtitle(string) override the subtitle on the combined graph

scheme(string) Stata graph scheme; default s2color

Output
saving(filename) save the combined graph as a .gph file

asis keep the results dataset in memory after the command (advanced)

depvar and indepvars must be numeric variables.
All panel requirements of xtpqcs apply.

Description

xtpqcsplot runs xtpqcs at every quantile in
quantiles() and produces a publication-quality coefficient
process plot of betaj(tau) together with two pointwise
confidence bands:

Red shaded band -- Robust common-shock-aware CI from
Chiang, Galvao and Wei (2026).

Blue dashed band -- Classical Kato et al. (2012)
sandwich CI (assumes cross-sectional independence).

A horizontal reference line is drawn at zero. The two bands together
let the practitioner visually assess:

(i) how the regression coefficient varies across quantiles
(heterogeneous effects);

(ii) by how much the classical procedure understates
uncertainty when common shocks are present.

When noclassical is specified, only the robust (red) band is shown.
When multiple regressors are requested, each variable gets its own
sub-graph and they are combined into a single panel (unless
nocombine is given).

Options

Required

id(varname) specifies the cross-sectional identifier.
Same as in xtpqcs.

time(varname) specifies the time identifier.
Same as in xtpqcs.

Quantile grid

quantiles(numlist) specifies the grid of quantile
indices at which to estimate. All values must lie strictly between
0 and 1. Default is 0.10 0.25 0.50 0.75 0.90. For a smooth
process plot use a fine grid such as 0.05(0.05)0.95 (19 points).

Variable selection

variables(varlist) selects a subset of the
independent variables to plot. By default all indepvars are
plotted. Use this when you have many regressors but only care about
one or two.

Estimation

bandwidth(#), kernel(string),
and level(#) are passed through to each
xtpqcs call. See xtpqcs for details.

Plot appearance

noclassical suppresses the blue classical CI band. Useful
when you only want to display the robust (common-shock-aware) band.

nocombine prevents the automatic graph combine of
multi-regressor plots. Each variable's graph is left as a separate
named graph in memory.

title(string) overrides the main title on the combined
panel. Enclose text in quotes.

subtitle(string) overrides the subtitle on the combined
panel. Enclose text in quotes.

scheme(string) specifies the Stata graph scheme.
Default is s2color.

Output

saving(filename) saves the combined graph as a
Stata .gph file.

asis keeps the estimation-results dataset in memory after the
command finishes. By default the original data is restored. This is
an advanced option for users who wish to do custom post-processing of
the quantile-by-quantile estimates.

Requirements

Stata version: 14.0 or later.

Dependencies: xtpqcs must be installed. If you installed
the xtpqcs package, this is included automatically.

Panel structure: Same requirements as xtpqcs: balanced or
moderately unbalanced, N >= 2, T >= 5.

Graph capability: Results require a graph-capable Stata session.
In batch mode (/e), graphs are created but not displayed; use
graph export to save as PNG/PDF.

Memory: A fine grid (e.g. 19 quantiles x 10 regressors) calls
xtpqcs 190 times. This is computationally intensive for very
large panels. Consider using a coarser grid for initial exploration.

Warnings and cautions

WARNING: Computation time. Each quantile x variable
combination requires a full xtpqcs estimation. A fine grid
such as 0.05(0.05)0.95 on a panel with N=1000, T=50 and 3
regressors will run xtpqcs 19 x 3 = 57 times. This may take
several minutes. Start with the default 5-point grid to verify the
data work, then refine.

WARNING: Extreme quantiles. Estimating at tau = 0.01 or
tau = 0.99 with small T can produce unreliable coefficients. Stay
within [0.05, 0.95] unless T >= 100.

CAUTION: Variable labels. Plot titles use variable
labels if they exist, and fall back to variable names. Ensure that
labels are informative (e.g., label variable X "Expenditure").

CAUTION: title() with nocombine. When nocombine is
specified, the title() and subtitle() options are ignored
because no combined graph is produced.

CAUTION: graph export. After running xtpqcsplot,
use graph export "filename.png", replace width(1600) to save
the plot. The combined graph is named xtpqcs_process.

Examples

Example 1: Default quantile process

. xtpqcsplot y X, id(id) time(t)

Estimates beta(tau) at tau = 0.10, 0.25, 0.50, 0.75, 0.90-
and produces a single plot with both CI bands.

Example 2: Fine quantile grid (19 points)

. xtpqcsplot y X, id(id) time(t) quantiles(0.05(0.05)0.95)

Example 3: Multiple regressors, combined panel

. xtpqcsplot y X1 X2 X3, id(id) time(t) quantiles(0.10(0.10)0.90)

Produces three sub-graphs (one per regressor) combined into a single
panel.

Example 4: Plot only a subset of regressors

. xtpqcsplot y X1 X2 X3, id(id) time(t) variables(X1 X2)

Example 5: Robust-only CI (no classical band)

. xtpqcsplot y X, id(id) time(t) noclassical

Example 6: Custom title and export

. xtpqcsplot y X, id(id) time(t)

. title("Effect of X on Y across Quantiles")

. subtitle("Robust CI (red) vs Classical CI (blue)")

. graph export "quantile_process.png", replace width(1600)

Example 7: Kernel comparison

. xtpqcsplot y X, id(id) time(t) kernel(gaussian) nocombine

. graph rename Graph gauss_plot

. xtpqcsplot y X, id(id) time(t) kernel(epanechnikov) nocombine

. graph rename Graph epan_plot

. graph combine gauss_plot epan_plot, title("Kernel Comparison")

Stored results

xtpqcsplot stores the following in r():

Macros

r(quantiles) the quantile grid used

r(variables) the variables plotted

In addition, the e() results from the last xtpqcs
call made internally remain available (the last quantile in the grid).

References

Chiang, H. D., A. F. Galvao, and C.-M. Wei. 2026.
Panel Quantile Regression with Common Shocks.
arXiv:2602.19201.

Kato, K., A. F. Galvao, and G. V. Montes-Rojas. 2012. Asymptotics for panel
quantile regression models with individual effects.
Journal of Econometrics 170: 76-91.

Also see

Help: xtpqcs, xtpqcsmc

Author

Dr. Merwan Roudane

Email: merwanroudane920@gmail.com

Stata implementation of Chiang, Galvao and Wei (2026).