*! version 1.0.0 25mar2026

Title

xtlmbreak -- Panel LM cointegration test with multiple structural breaks

Version: 1.0.0
Date: 25 March 2026
Author: Dr Merwan Roudane (merwanroudane920@gmail.com)

Syntax

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

Model
model(string) deterministic specification; default is intercept

estimator(string) estimation method: dols or fmols; default is dols

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

trim(#) trimming parameter; default is 0.15

maxiter(#) maximum iterations for break estimation; default is 50

tolerance(#) convergence criterion; default is 0.0001

Output
graph display and export visualizations of break dates and LM statistics

A balanced panel dataset must be declared using xtset panelvar timevar
before using xtlmbreak; see xtset.

Description

xtlmbreak implements the panel LM test for the null hypothesis of
cointegration proposed by Westerlund (2006), published in the
Oxford Bulletin of Economics and Statistics. The test extends the
McCoskey and Kao (1998) panel LM cointegration test to allow for
multiple structural breaks in both the level and trend of the
cointegrated panel regression.

The command is a direct translation of the original GAUSS code
(llm.src) written by Joakim Westerlund.

The test is based on the LM principle and tests:

H0: All individuals in the panel are cointegrated

H1: At least some individuals are not cointegrated

The test statistic has a limiting standard normal distribution under H0.
Structural breaks are allowed under both the null and alternative
hypotheses, which avoids the interpretational difficulties associated
with tests that only allow breaks under the alternative.

The test proceeds as follows:

1. For each panel unit, determine the number and locations of structural
breaks using the Bai and Perron (1998, 2003) dynamic programming algorithm
with BIC model selection. This step applies only to Cases 4 and 5.

2. Estimate the cointegrating regression for each subsample using
either DOLS (Saikkonen, 1991) or FMOLS (Phillips and Hansen, 1990) to
obtain efficient residuals.

3. Compute the individual LM statistics based on cumulative sums of
the efficient residuals, using a Fejér/Bartlett kernel estimate of the
long-run variance with bandwidth [T^(1/3)].

4. Standardize the panel statistic using response surface moments
from Westerlund (2006, Tables 2 and 3), which provide finite-sample
corrected expected values and variances.

Options

Model

model(string) specifies the deterministic component of the
cointegrating regression. Options are:

none (or 1) -- Case 1: no deterministic component

intercept (or 2) -- Case 2: individual-specific intercept [default]

trend (or 3) -- Case 3: individual intercept and trend

levelbreak (or 4) -- Case 4: intercept with level breaks

trendbreak (or 5) -- Case 5: intercept and trend with breaks

estimator(string) selects the efficient estimation method:
dols (default) uses Dynamic OLS with [T^(1/3)] leads and lags;
fmols uses Fully Modified OLS with Bartlett kernel bandwidth [T^(1/3)].

Break detection

maxbreaks(#) sets the maximum number of structural breaks to
search for. The actual number is selected by BIC. Default is 5.

trim(#) sets the trimming parameter epsilon, which imposes a
minimum subsample length of [epsilon*T]. Default is 0.15, following
Bai and Perron (2003).

maxiter(#) maximum iterations for the Bai-Perron iterative
break estimation procedure. Default is 50.

tolerance(#) convergence criterion for the iterative break
estimation. The algorithm stops when |SSR_new - SSR_old| < tolerance.
Default is 0.0001.

Output

graph produces two visualizations when break models (Cases 4-5)
are used: (1) a timeline chart of estimated break dates by panel;
(2) a bar chart of individual LM statistics. Graphs are automatically
exported as xtlmbreak_breaks.png and xtlmbreak_lm.png in
the current working directory.

Deterministic specifications

The data generating process is:

y_it = z_it' * c_ij + x_it' * b_i + e_it

e_it = r_it + u_it

r_it = r_ + phi_i * u_it

where x_it is a K-dimensional I(1) regressor, z_it contains deterministic
components, and the index j = 1,...,M_i+1 denotes regimes. Under H0,
phi_i = 0 for all i.

Case Deterministic specification

1 (none) z_it = empty

2 (intercept) z_it = 1 (individual-specific intercept)

3 (trend) z_it = (1, t)' (intercept and trend)

4 (levelbreak) z_it = 1, with M_i level breaks

5 (trendbreak) z_it = (1, t)', with M_i level and trend breaks

Cases 1-3 do not involve structural breaks (M_i = 0 for all i).
Cases 4-5 allow multiple breaks with locations and number estimated
from the data using the Bai-Perron algorithm and BIC selection.

Methodology

Individual LM statistic:

For each panel unit i in regime j with T_ij observations, the LM
statistic sums the squared partial sums of efficient residuals:

LM_ij = (1/T_ij^2) * omega_hat^(-2) * sum_t S_it^2

where S_it = sum_^ e*_ik are partial sums of DOLS
or FMOLS residuals and omega_hat^2 is the long-run conditional variance
estimated with a Bartlett/Fejér kernel with bandwidth [T^(1/3)].

Panel statistic (Theorem 1):

The individual LM statistics across regimes are summed and then
standardized using response surface moments Q (expected value) and
R (variance) from Westerlund (2006, Tables 2-3):

Z(M) = sqrt(N) * [ (1/N) * sum_i LM_i - mu_bar ] / sqrt(R_bar)

where mu_bar = (1/N) * sum_i (M_i+1)*Q and
R_bar = (1/N) * sum_i (M_i+1)^2*R.

Under H0, Z(M) converges to a standard normal distribution as
N -> infinity. The test rejects H0 for large positive values
of Z(M), using the right tail of the N(0,1) distribution.

Key property: The limiting distribution depends on M_i (the number
of breaks) but is invariant to the break locations. The moments
Q and R are functions of the model case (1-5), the number of
regressors K, the estimator (DOLS/FMOLS), and the sample size T.

Assumptions and requirements

Data requirements:

1. Panel data must be declared with xtset.

2. The panel must be balanced (same T for all units).

3. The dependent variable y and regressors x must be I(1).

4. At least one independent variable is required.

Statistical assumptions (Westerlund, 2006):

Cross-sectional independence: Panel members are independent
(Assumption 1(i)). For dependent panels, consider combining with
cross-sectional demeaning or bootstrap procedures.

Serial correlation: General forms of within-unit serial
dependence are allowed (Assumption 1(ii)). The Bartlett kernel provides
a heteroskedasticity- and autocorrelation-consistent variance estimate.

Endogeneity: Regressors x may be endogenous. Both DOLS and
FMOLS yield consistent estimation under endogeneity.

Break locations: Breaks are modeled as fixed fractions of T
with consecutive breaks being asymptotically distinct (Assumption 2).

Minimum sample: For reliable finite-sample performance,
each subsample should contain at least 30 observations. Use
trim(0.15) (default) as recommended by Bai and Perron (2003).

Interpretation

Reading the output:

1. A large positive Z(M) provides evidence against
cointegration.

2. Compare Z(M) with right-tail critical values of N(0,1):
1.282 (10%), 1.645 (5%), 2.326 (1%).

3. If Z(M) exceeds the critical value, reject H0 and
conclude that at least some panel members are not cointegrated.

4. If Z(M) does not exceed the critical value, fail to
reject H0: the panel is cointegrated (with the specified break
structure).

Practical guidance:

Ignoring breaks leads to size distortions.
If cointegration is rejected using Cases 1-3, re-test with
Cases 4-5. Omitted structural breaks inflate the LM statistic and
can cause spurious rejection of cointegration.

Overspecifying the break model reduces power.
If the true DGP has no breaks, using Cases 4-5 produces valid but
less powerful tests compared to Cases 2-3.

Break dates are data-driven.
Report the break dates from r(breaks) and interpret them as approximate
indicators of regime changes.

Examples

Setup: Simulated cointegrated panel

. clear

. set seed 12345

. set obs 1000

. gen id = ceil(_n/100)

. bysort id: gen t = _n

. xtset id t

. bysort id (t): gen x = sum(rnormal())

. gen y = 1 + x + rnormal()*0.5

Example 1: Test with individual intercept (Case 2, default)

. xtlmbreak y x

Example 2: Test with intercept and trend (Case 3)

. xtlmbreak y x, model(trend)

Example 3: Level break model with FMOLS

. xtlmbreak y x, model(levelbreak) estimator(fmols)

Example 4: Trend break model with visualization

. xtlmbreak y x, model(trendbreak) maxbreaks(3) graph

Example 5: Accessing stored results

. xtlmbreak y x, model(levelbreak)

. di "Z(M) = " r(Z_M) ", p-value = " r(p_value)

. mat list r(breaks)

Stored results

xtlmbreak stores the following in r():

Scalars

r(Z_M) standardized panel Z(M) test statistic

r(p_value) p-value from right tail of N(0,1)

r(mean_lm) average of individual LM statistics

r(mu_bar) cross-sectional mean mu_bar

r(R_bar) cross-sectional variance R_bar

r(Q) response surface expected value Q

r(R) response surface variance R

r(N) number of panel units

r(T) number of time periods

r(K) number of regressors

r(maxbreaks) maximum breaks specified

Matrices

r(breaks) (maxbreaks+1 x N) matrix: row 1 = number of
breaks per panel; rows 2+ = estimated break dates

Macros

r(model) deterministic model specification

r(estimator) estimation method

r(depvar) dependent variable name

r(indepvars) independent variable names

References

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

Bai, J. and P. Perron (2003). Computation and analysis of multiple
structural change models.
Journal of Applied Econometrics 18(1): 1-22.
https://doi.org/10.1002/jae.659

Harris, D. and B. Inder (1994). A test of the null hypothesis of
cointegration. In Hargreaves C.P. (ed.),
Nonstationary Time Series Analysis and Cointegration,
Oxford University Press, pp. 133-152.

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

Phillips, P.C.B. and B.E. Hansen (1990). Statistical inference in
instrumental variables regression with I(1) processes.
Review of Economic Studies 57(1): 99-125.
https://doi.org/10.2307/2297545

Saikkonen, P. (1991). Asymptotically efficient estimation of
cointegration regressions.
Econometric Theory 7(1): 1-21.
https://doi.org/10.1017/S0266466600004217

Shin, Y. (1994). A residual-based test of the null of cointegration
against the alternative of no cointegration.
Econometric Theory 10(1): 91-115.
https://doi.org/10.1017/S0266466600008240

Westerlund, J. (2006). Testing for panel cointegration with multiple
structural breaks.
Oxford Bulletin of Economics and Statistics 68(1): 101-132.
https://doi.org/10.1111/j.1468-0084.2006.00154.x

Author

Dr Merwan Roudane

Email: merwanroudane920@gmail.com

Based on original GAUSS code (llm.src) by:

Joakim Westerlund

Department of Economics, Lund University

Please cite as:

Roudane, M. (2026). xtlmbreak: Panel LM cointegration test with
multiple structural breaks in Stata. Version 1.0.0.