*! version 1.0.0 xtquantilebreak
help xtquantilebreakversion 1.0.0

Title

xtquantilebreak -- Shrinkage quantile regression for panel data with
multiple structural breaks

Syntax

xtquantilebreak depvar indepvars [if] [in]
[, options]

The data must be xtset and form a strongly balanced panel before estimation.

Model
quantiles(numlist) quantile levels to estimate; default
quantiles(0.25 0.5 0.75)

noconstant suppress the (break-varying) intercept

Penalization
l2ambda(numlist) grid of fused-lasso penalties searched by the
information criterion; default is a log-spaced grid

l1ambda(real) penalty on the individual effects; default
lambda1(0.05)

kappa(real) adaptive-weight exponent {&kappa}; default
kappa(1)

rconstant(real) constant r in the IC penalty term; default
rconstant(0.5)

Numerical
maxiter(integer) maximum block-coordinate-descent iterations;
default maxiter(15)

tolerance(real) convergence tolerance; default tolerance(1e-4)

Reporting
nograph suppress graphical output

heatmap add a break-intensity heatmap to the graphical output

level(#) confidence level for the plotted band; default
level(95)

Description

xtquantilebreak estimates the panel quantile regression model of
Zhang, Zhu, Feng and He (2022), in which the
slope coefficients are allowed to change at an unknown number of structural
breaks whose locations are determined by the data. For each requested quantile
level {&tau} the model is

Q{&tau}(yit | xit, {&alpha}i) = {&alpha}i + xit{&beta}t,{&tau}

where {&alpha}i are individual effects (shared across quantiles)
and {&beta}t,{&tau} are time-varying, quantile-specific slopes.
Breaks occur at periods where {&beta}t,{&tau} differs from
{&beta}t-1,{&tau}. The number and location of the breaks are
estimated jointly with the coefficients through an adaptive fused-lasso penalty,
and may differ across quantile levels. The covariate dimension p is
permitted to grow with the sample size.

Estimation proceeds in two stages. A penalized fit selects the break pattern; a
post-lasso unpenalized quantile regression is
then run on each detected regime to remove shrinkage bias and to obtain the
reported coefficients and standard errors.

Options

Model

quantiles(numlist) supplies the quantile levels, each strictly between 0
and 1, in increasing order. The break pattern is estimated separately for each
level. Default is quantiles(0.25 0.5 0.75).

noconstant omits the intercept. By default a break-varying intercept is
included as the first coefficient (_cons).

Penalization

lambda2(numlist) is the grid of fused-lasso tuning parameters. The value
minimizing the information criterion (see Methodology) is selected and
reported. A finer or wider grid increases computation but may improve break
recovery. Default is lambda2(0.005 0.01 0.025 0.05 0.1 0.25 0.5 1).

lambda1(real) penalizes the magnitude of the individual effects, stabilizing
their estimation. Default is lambda1(0.05).

kappa(real) is the exponent {&kappa} of the adaptive weights
{&omega}t = ||{&beta}t - {&beta}t-1||{1}{-{&kappa}},
computed from a preliminary unpenalized fit. Larger {&kappa} sharpens the
adaptive penalty. Default is kappa(1).

rconstant(real) is the constant r scaling the IC complexity penalty
{&rho} = r{&middot}ln(min(N,T))/min(N,T). Default is rconstant(0.5).

Numerical

maxiter(integer) caps the number of outer block-coordinate-descent
iterations (alternating between slopes and individual effects). Default 15.

tolerance(real) sets the relative-change convergence threshold on the
individual effects. Default 1e-4.

Reporting

nograph suppresses all graphical output.

heatmap requests an additional break-intensity heatmap.

level(#) sets the confidence level of the plotted coefficient band; the band
is drawn only when a single quantile is requested. Default is level(95).

Methodology

The estimator minimizes the check-loss objective summed over quantiles, subject
to an L1 penalty on the individual effects and an adaptive fused-lasso penalty on
the first differences {&theta}t,{&tau} = {&beta}t,{&tau} - {&beta}t-1,{&tau}.
Reparameterizing in {&theta} turns break detection into a sparsity problem:
a break occurs wherever ||{&theta}t,{&tau}|| 0, and the
coefficients are recovered as the cumulative sum of {&theta}.

Because Mata has no native linear-programming quantile solver, the check loss is
optimized by a Hunter-Lange majorize-minimize scheme (iteratively reweighted
least squares), the fused-L1 penalty is handled by local quadratic approximation,
and the slope blocks and individual effects are updated by block coordinate
descent. The individual-effects update is the exact penalized weighted median over
the candidate kink points.

The fused-lasso penalty {&lambda}2 is chosen to minimize

IC({&lambda}) = ln({&sigma}2) + {&rho}{&middot}{&Sigma}k(mk + 1)

where mk is the number of breaks at quantile k,
{&sigma}2 is the mean post-lasso check loss, and
{&rho} = r{&middot}ln(min(N,T))/min(N,T).

Standard errors are obtained from a Powell kernel sandwich estimator computed on
each regime sub-sample.

Output

The displayed table follows the layout of Table 6 of Zhang et al. (2022): for each
quantile level the estimated regimes are listed as rows giving the time range
(start-end) and one column of coefficient estimates per regressor, with
significance stars. Two graphs are produced by default: per-regressor coefficient
step paths with break markers across quantiles, and a map of break timing by
quantile.

Examples

Set up the panel and estimate at the default quartiles:

. xtset id year

. xtquantilebreak y x1 x2 x3

A single median fit with a 90% coefficient band:

. xtquantilebreak y x1 x2, quantiles(0.5) level(90)

Five quantile levels with a custom penalty grid and stronger adaptive weights:

. xtquantilebreak y x1 x2 x3, quantiles(0.1 0.25 0.5 0.75 0.9) ///

lambda2(0.01 0.05 0.1 0.5 1 2) kappa(2)

No intercept and suppressed graphs:

. xtquantilebreak y x1 x2, noconstant nograph

Stored results

xtquantilebreak stores the following in e():

Scalars

e(N) number of cross-sections

e(T) number of time periods

e(p) number of regressors

e(K) number of quantile levels

e(nbreaks) total number of detected breaks

e(lambda2) selected fused-lasso penalty

e(lambda1) individual-effects penalty

e(kappa) adaptive-weight exponent

e(ic) minimized information criterion

Macros

e(cmd) xtquantilebreak

e(cmdline) command as typed

e(depvar) name of dependent variable

e(indepvars) names of regressors

e(quantiles) requested quantile levels

e(coefnames) coefficient names

e(title) title for output

Matrices

e(reginfo) regime index map (quantile, regime, start, end)

e(coef) regime-specific coefficients

e(se) regime-specific standard errors

e(betapath) full T-by-(K*pp) coefficient paths

e(breaks) K-by-T break indicator matrix

e(alpha) estimated individual effects

e(ic_path) IC value at each grid point

e(lambda_grid) fused-lasso penalty grid

References

Zhang, Y., Zhu, Y., Feng, S., and He, X. 2022. Shrinkage quantile regression for
panel data with multiple structural breaks. Canadian Journal of Statistics
50(3): 820-851.

Hunter, D. R., and Lange, K. 2000. Quantile regression via an MM algorithm.
Journal of Computational and Graphical Statistics 9(1): 60-77.

Powell, J. L. 1991. Estimation of monotonic regression models under quantile
restrictions. In Nonparametric and Semiparametric Methods in Econometrics and
Statistics, eds. W. A. Barnett, J. Powell, and G. Tauchen. Cambridge University
Press.