*! version 2.0.0 26mar2026

Title

xtpcointegboot -- Bootstrap panel cointegration test (Westerlund-Edgerton, 2007)

Syntax

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

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

estimator(string) VAR estimator; ols or yw (Yule-Walker); default is yw

lags(#) VAR lag order for sieve bootstrap; default = int(4*(T/100)^(2/9))

nboot(#) number of bootstrap replications; default is 399

graph display bootstrap distribution histogram

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

Description

xtpcointegboot implements the bootstrap panel cointegration test proposed by
Westerlund and Edgerton (2007, Economics Letters).
The test examines the null hypothesis of cointegration (i.e., all panel units
are cointegrated) against the alternative that at least some units are not
cointegrated.

The procedure computes the McCoskey and Kao (1998) LM+ test statistic from
fully modified OLS (FM-OLS) residuals. The FM-OLS estimator adjusts
for endogeneity and serial correlation in the cointegrating regression.
The standardized panel statistic aggregates individual LM statistics,
recentered by mean and variance correction factors that depend on the
number of regressors.

Because the asymptotic critical values are poorly sized when cross-sectional
dependence is present, the test employs a sieve bootstrap to generate
panel-specific critical values. The bootstrap scheme fits a VAR to the
first-differenced data (using OLS or Yule-Walker), generates pseudo-data from
the AR filter with resampled innovations, and recomputes the LM+ statistic
in each replication. The bootstrap p-value measures the proportion of
bootstrap statistics that exceed the observed value.

Both asymptotic and bootstrap p-values are reported. Rejection occurs in the
right tail: large positive values indicate evidence against cointegration.

Options

model(string) specifies the deterministic component:

constant: individual intercepts only.

trend: individual intercepts and linear time trends.

estimator(string) specifies the VAR estimation method for the sieve bootstrap:

yw: Yule-Walker estimation (recommended). Ensures stationarity of the fitted AR process.

ols: ordinary least squares estimation.

lags(#) sets the lag order for the sieve bootstrap VAR.
Default is int(4*(T/100)^(2/9)), the Andrews-Schwarz rule.

nboot(#) the number of bootstrap replications.
Default is 399. Increasing this improves the precision of the bootstrap
p-value at the cost of computation time.

graph displays a histogram of the bootstrap distribution of
the LM+ statistic, with a vertical line marking the observed sample value.

Stored results

xtpcointegboot stores the following in r():

Scalars

r(lm) normalized LM+ test statistic

r(boot_pval) bootstrap p-value

r(asym_pval) asymptotic p-value

r(mu) adjustment mean (E[LM+] under H0)

r(vr) adjustment variance (Var[LM+] under H0)

r(N) number of panels

r(T) number of time periods

r(K) number of independent variables

r(lags) VAR lag order used

r(nboot) number of bootstrap replications

Matrices

r(indiv_lm) individual LM statistics (N x 1)

Macros

r(model) model label

r(estimator) estimator 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

Constant model with bootstrap (default Yule-Walker)

. xtpcointegboot y x, model(constant) nboot(399)

Trend model with OLS estimator and histogram

. xtpcointegboot y x, model(trend) estimator(ols) nboot(199) graph

Custom lag order

. xtpcointegboot y x, model(constant) lags(4) nboot(999)

References

Westerlund, J. and D.L. Edgerton. 2007.
A panel bootstrap cointegration test.
Economics Letters 97(3): 185-190.

McCoskey, S.K. and C. Kao. 1998.
A residual-based test of the null of cointegration in panel data.
Econometric Reviews 17(1): 57-84.

Pedroni, P. 2004.
Panel cointegration: asymptotic and finite sample properties of pooled
time series tests with an application to the PPP hypothesis.
Econometric Theory 20(3): 597-625.

Authors

Dr Merwan Roudane

merwanroudane920@gmail.com

Also see

Online: [XT] xtset, [XT] xtunitroot

xtpcointegwe, xtpkpss