*! version 2.0.0 26mar2026

Title

xtpkpss -- Panel KPSS stationarity test with structural breaks (Carrion-i-Silvestre et al., 2005)

Syntax

xtpkpss
varname
[if] [in]
[, options]

model(string) deterministic specification; constant, trend, constbreak, or trendbreak; default is constant

maxbreaks(#) maximum number of structural breaks; default is 5

kernel(string) kernel for LRV estimation; bartlett or qs; default is bartlett

bandwidth(#) bandwidth for kernel; default = int(4*(T/100)^(2/9))

trim(#) trimming fraction for break search; default is 0.10

graph display individual KPSS bar chart and break date timeline

A balanced panel must be declared via xtset panelvar timevar before calling xtpkpss.

Description

xtpkpss implements the panel stationarity test proposed by
Carrion-i-Silvestre, del Barrio-Castro, and López-Bazo (2005,
Econometrics Journal).
The test examines the null hypothesis of stationarity
(possibly with structural breaks) against the alternative that at least some
panel units contain a unit root.

The test extends the univariate KPSS test of Kwiatkowski et al. (1992) to
panel data, building on the panel framework of Hadri (2000).
When structural breaks are allowed (model(constbreak) or
model(trendbreak)), the number and location of breaks are determined
endogenously for each panel unit using the sequential procedure of
Bai and Perron (1998), with the modified Bayesian information criterion
(LWZ) of Liu, Wu, and Zidek (1997) for selecting the optimal number of
breaks.

Two standardized panel statistics are reported:

Z(hom): assumes homogeneous long-run variance across panel units.

Z(het): allows for heterogeneous long-run variances across units.

Under the null, both statistics converge to standard normal. Rejection
occurs in the right tail: large positive values indicate evidence
against stationarity.

Options

model(string) specifies the deterministic component:

constant: level stationarity (KPSS-mu). Tests whether the series is stationary around a constant mean.

trend: trend stationarity (KPSS-tau). Tests whether the series is stationary around a linear trend.

constbreak: level stationarity with endogenous level breaks. Allows the intercept to shift at unknown dates.

trendbreak: trend stationarity with level and slope breaks. Allows both the intercept and the trend slope to shift.

maxbreaks(#) the maximum number of structural breaks to consider when
model() is constbreak or trendbreak.
The sequential Bai-Perron procedure tests up to this many breaks; the LWZ
criterion selects the optimal number. Default is 5.

kernel(string) specifies the kernel function used to estimate the
long-run variance:

bartlett: Bartlett (triangular) kernel.

qs: Quadratic Spectral kernel.

bandwidth(#) bandwidth for the kernel function.
Default is int(4*(T/100)^(2/9)), the Andrews-Schwarz rule.

trim(#) the trimming fraction used when searching for structural breaks.
Breaks are restricted to lie in [trim*T, (1-trim)*T]. Default is 0.10.

graph displays two graphs: (1) a bar chart of individual KPSS
statistics with a horizontal line at the panel mean, and (2) when breaks
are estimated, a timeline showing estimated break dates for each panel unit.

Stored results

xtpkpss stores the following in r():

Scalars

r(z_hom) homogeneous panel Z statistic

r(z_het) heterogeneous panel Z statistic

r(pval_hom) p-value for Z(hom) (right-tail of N(0,1))

r(pval_het) p-value for Z(het) (right-tail of N(0,1))

r(lm_hom) homogeneous LM statistic (before standardization)

r(lm_het) heterogeneous LM statistic (before standardization)

r(mu_bar) average correction mean

r(var_bar) average correction variance

r(N) number of panels

r(T) number of time periods

r(bandwidth) bandwidth used

Matrices

r(kpss) individual KPSS statistics (N x 1)

r(lrvar) individual long-run variances (N x 1)

r(breaks) estimated break dates (maxbreaks x N)

r(nbreaks) number of breaks per unit (N x 1)

Macros

r(model) model label

r(kernel) kernel label

r(depvar) variable name

Examples

Setup: balanced panel

. webuse pennxrate, clear

. xtset id year

Level stationarity test (no breaks)

. xtpkpss y, model(constant)

Trend stationarity test

. xtpkpss y, model(trend) kernel(qs) bandwidth(6)

Level stationarity with structural breaks and graph

. xtpkpss y, model(constbreak) maxbreaks(3) graph

Trend stationarity with breaks, custom trimming

. xtpkpss y, model(trendbreak) maxbreaks(5) trim(0.15)

References

Carrion-i-Silvestre, J.L., T. del Barrio-Castro, and E. López-Bazo. 2005.
Breaking the panels: An application to the GDP per capita.
Econometrics Journal 8(2): 159-175.

Hadri, K. 2000.
Testing for stationarity in heterogeneous panel data.
Econometrics Journal 3(2): 148-161.

Kwiatkowski, D., P.C.B. Phillips, P. Schmidt, and Y. Shin. 1992.
Testing the null hypothesis of stationarity against the alternative
of a unit root.
Journal of Econometrics 54(1-3): 159-178.

Bai, J. and P. Perron. 1998.
Estimating and testing linear models with multiple structural changes.
Econometrica 66(1): 47-78.

Authors

Dr Merwan Roudane

merwanroudane920@gmail.com

Also see

Online: [XT] xtset, [XT] xtunitroot

xtpcointegwe, xtpcointegboot