*! version 2.0.0 26mar2026

Title

xtpcointegwe -- Panel cointegration test with structural breaks and common factors (Westerlund-Edgerton, 2008)

Syntax

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

model(string) deterministic specification; nobreak, levelshift, or regimeshift; default is nobreak

lags(#) number of ADF augmentation lags; default = int(4*(T/100)^(2/9))

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

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

maxfactors(#) maximum number of common factors via Bai-Ng IC; default is 5

graph display multi-panel line graph with estimated break dates

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

Description

xtpcointegwe implements the panel cointegration test proposed by
Westerlund and Edgerton (2008, Oxford Bulletin of Economics and Statistics).
The test examines the null hypothesis of no cointegration (i.e., all panel units
exhibit a spurious regression) against the alternative that at least some units
are cointegrated.

The procedure is based on estimating individual ADF regressions on the residuals of the
cointegrating regression, augmented with leads and lags of the first-differenced regressors
and break dummies where applicable. Cross-sectional dependence is accommodated through
a common factor structure estimated via principal components; the number of factors
is selected by the Bai and Ng (2002) ICp1 information criterion.

Two standardized panel statistics are reported:

PD-Tau (t-ratio based): based on the sum of individual ADF t-statistics.

PD-Phi (coefficient based): based on the sum of individual ADF rho-coefficients, scaled by the long-run-to-short-run variance ratio.

Under the null, both statistics converge to standard normal. Rejection occurs in the
left tail: large negative values indicate evidence of cointegration.

Options

model(string) specifies the deterministic component:

nobreak: no structural break; the cointegrating regression contains an intercept and trend (Case 1).

levelshift: a single level break at an endogenously estimated date (Case 2).

regimeshift: shifts in both the level and the slope coefficient at an unknown date (Case 3).

lags(#) sets the number of lags in the ADF regression for serial correlation.
Default is int(4*(T/100)^(2/9)), following the Andrews-Schwarz rule.

bandwidth(#) the bandwidth for the Fejer kernel used in the long-run
variance estimation. Default is int(4*(T/100)^(2/9)).

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

maxfactors(#) maximum number of common factors considered for the
Bai-Ng information criterion. Set to 0 to disable factor estimation. Default is 5.

graph displays a combined line graph showing each panel's dependent variable
over time with vertical dashed lines at estimated break dates. Only available when
model() is levelshift or regimeshift.

Stored results

xtpcointegwe stores the following in r():

Scalars

r(zt) PD-Tau test statistic

r(za) PD-Phi test statistic

r(pval_zt) p-value for PD-Tau (left-tail of N(0,1))

r(pval_za) p-value for PD-Phi (left-tail of N(0,1))

r(N) number of panels

r(T) number of time periods

r(nfactors) number of common factors selected

r(lags) number of ADF lags used

r(bandwidth) bandwidth used

Matrices

r(breaks) estimated break dates (N x 1 vector)

Macros

r(model) model label

r(depvar) dependent variable name

r(indepvars) independent variable name(s)

Examples

Setup: balanced panel with cointegrated y and x

. webuse pennxrate, clear

. xtset id year

No structural break model

. xtpcointegwe y x, model(nobreak) maxfactors(3)

Level shift model with graphical output

. xtpcointegwe y x, model(levelshift) maxfactors(3) graph

Regime shift with wider trimming and custom lags

. xtpcointegwe y x, model(regimeshift) trim(0.15) lags(4) bandwidth(4)

References

Westerlund, J. and D.L. Edgerton. 2008.
A simple test for cointegration in dependent panels with structural breaks.
Oxford Bulletin of Economics and Statistics 70(5): 665-704.

Bai, J. and S. Ng. 2002.
Determining the number of factors in approximate factor models.
Econometrica 70(1): 191-221.

Gregory, A.W. and B.E. Hansen. 1996.
Residual-based tests for cointegration in models with regime shifts.
Journal of Econometrics 70(1): 99-126.

Authors

Dr Merwan Roudane

merwanroudane920@gmail.com

Also see

Online: [XT] xtset, [XT] xtunitroot

xtpcointegboot, xtpkpss