*! cobreakcoint.sthlp — v1.0.0 — 2026-04-18

Title

cobreakcoint -- Quasi-Likelihood Ratio Tests for Cointegration,
Cobreaking, and Cotrending

Syntax

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

Model
model(1|2) deterministic specification; default is 2

maxbreaks(#) maximum breaks to test: 0, 1, or 2; default is 2

klags(numlist) DOLS lag/lead values; default is 1 3 5 7 9

epsilon(real) trimming fraction; default is 0.15

Output
plot produce diagnostic visualization plots

notable suppress output tables

saving(string) filename stem for saved graphs

noisily display verbose Mata computation output

Description

cobreakcoint implements quasi-likelihood ratio (QLR) tests for the joint
analysis of cointegration, cobreaking, and cotrending in a bivariate
or multivariate system of I(1) variables that may contain structural breaks in
their deterministic components.

In applied macroeconomics and finance, researchers often test whether two
non-stationary (I(1)) variables share a long-run equilibrium (cointegration).
However, many macroeconomic time series exhibit structural breaks — permanent
shifts in their means or trends caused by policy changes, economic crises, or
institutional reforms. Standard cointegration tests (e.g., Engle-Granger, Johansen)
can produce misleading results when such breaks are present.

This command addresses three fundamental questions simultaneously:

Q1. Do the variables cointegrate? (Even if structural breaks are present)

The Qr test answers this question robustly, meaning it controls size
regardless of whether breaks exist.

Q2. Do the variables cobreak? (Do breaks cancel in the long-run relationship?)

The Qcb test answers whether both cointegration AND cobreaking hold jointly.
If H0 is not rejected, the breaks in individual series cancel out in the equilibrium.

Q3. Do the variables cotrend? (Do the trends cancel?)

The Qct test (Model II only) answers whether both cointegration AND cotrending
hold jointly. If H0 is not rejected, the deterministic trends in individual series
share a common stochastic trend.

Background and Key Concepts

Cointegration (CI)

Two I(1) variables y_t and x_t are cointegrated if there exists a linear
combination y_t - beta*x_t = u_t that is stationary (I(0)). This means the
variables share a common stochastic trend and move together in the long run.

Example: Government expenditures (E) and revenues (R) may individually wander
as random walks, but if they are cointegrated, the budget deficit E - beta*R is
stationary, implying a sustainable fiscal policy.

Cobreaking (CB)

Two I(1) variables with structural breaks are said to cobreak if the breaks
in y_t and x_t cancel out in the long-run relationship y_t - beta*x_t. That is,
even though each series individually has level shifts, the equilibrium error
does not exhibit those shifts.

Example: If both E and R shift upward around 1967 due to the Great Society
programs, but the deficit (E - beta*R) remains unaffected, then E and R cobreak.

Intuition: Cobreaking means the structural breaks have the same "direction and
magnitude" in both series (after scaling by beta), so they wash out in the
equilibrium relationship.

Cotrending (CT)

Two I(1) variables with deterministic trends are said to cotrend if the
trends cancel in the long-run relationship. This is relevant only for Model II
which includes a linear trend in the deterministic specification.

Example: If both E and R have deterministic upward trends (e.g., due to
steady GDP growth), and these trends cancel in E - beta*R, then the series cotrend.

Structural Breaks

A structural break is a permanent, discrete change in the deterministic
component of a time series. In the context of this command:

- Model I breaks are level shifts (mean shifts): the series jumps to a
new level at the break date.

- Model II breaks are intercept shifts with trend: the intercept changes
but the linear trend coefficient remains the same.

The break dates can be either known (specified by the researcher) or
unknown (estimated from the data by maximizing the log-likelihood).

DOLS Endogeneity Correction

The Dynamic OLS (DOLS) method of Saikkonen (1991) and Stock & Watson (1993)
corrects for endogeneity by including leads and lags of the first-differenced
regressors in the cointegrating regression:

y_t = beta*x_t + d_t'*gamma + SUM_^ delta_j * Dx_ + u_t

The parameter klags() controls k. Multiple values are recommended to
assess sensitivity. The paper uses k = 1, 3, 5, 7, 9.

Lambda-bar (Lbar) Parameter

The test statistics use a quasi-likelihood ratio approach where the
alternative hypothesis is parameterized by theta = 1 - Lbar/T. The Lbar
values are calibrated from the asymptotic distribution tables to maximize
power. They depend on the model, number of breaks, and number of regressors.

Long-run Variance Estimation

The long-run variance of the residuals is estimated using the Quadratic
Spectral (QS) kernel with the data-dependent bandwidth of Andrews (1991).
This provides a consistent estimate of the spectral density at frequency zero,
which is needed because the cointegrating residuals may be serially correlated.

Model Specifications

Model I — Mean Shifts

The data generating process is:

y_t = beta*x_t + mu_0 + SUM_^ mu_j * DU_t(T_j) + u_t

where DU_t(T_j) = 1 if t > T_j, 0 otherwise. The breaks are pure level shifts.
There is no linear trend in Model I. The cotrending test (Qct) is not
available under Model I.

Use Model I when: your data has no deterministic trend but may have
permanent level shifts (e.g., exchange rates, interest rate spreads).

Model II — Trend with Intercept Shifts

The data generating process is:

y_t = beta*x_t + mu_0 + SUM_^ mu_j * DU_t(T_j) + omega*t + u_t

This includes a linear deterministic trend (omega*t) plus intercept shifts.
All three tests (Qr, Qcb, Qct) are available.

Use Model II when: your data exhibits trending behavior plus possible level
shifts (e.g., GDP ratios, government budget variables, consumption-income ratios).

Test Statistics

Qr — Robust Cointegration Test

Null hypothesis: y_t and x_t are cointegrated (u_t is I(0)).

Key feature: The Qr statistic is robust to the presence or absence of
structural breaks. Its asymptotic distribution does not depend on whether
cobreaking or cotrending holds. This means:

- You do NOT need to know the number of breaks

- You do NOT need to know the break dates

- The test has correct size regardless of break structure

Reject H0 if: Qr > critical value. Rejection means no cointegration.

The Qr statistic is computed for each number of breaks (m = 0, 1, 2) with
unknown break dates. The break date is estimated under H0 of cointegration
by minimizing the sum of squared residuals.

Qcb — Joint CI and Cobreaking Test

Null hypothesis: y_t and x_t are cointegrated AND the structural breaks
cancel in the cointegrating relationship (cobreaking holds).

Under H0, the break coefficients mu_1 = ... = mu_m = 0 in the cointegrating
regression. The test includes a penalty term m*ln(T) which arises from the
information criterion used to determine the break number.

Reject H0 if: Qcb > critical value. Three possible interpretations
of rejection:

(a) No cointegration, or

(b) Cointegration holds but cobreaking does not (breaks do NOT cancel), or

(c) Both fail.

Key insight: If you reject Qcb but fail to reject Qr, then
cointegration holds BUT cobreaking does not. The breaks persist in the
equilibrium relationship.

Qct — Joint CI and Cotrending Test

Null hypothesis: y_t and x_t are cointegrated AND cotrending holds
(the deterministic trends cancel). Only available under Model II.

Under H0, both mu_1 = ... = mu_m = 0 and omega = 0. The penalty is
(m+2)*ln(T) plus an adjustment for the trending regressors.

Reject H0 if: Qct > critical value. Rejection means either no
cointegration, no cotrending, or both.

Dmax_cb and Dmax_ct — Double-Maximum Tests

The Dmax statistics are omnibus tests that do not require specifying
the number of breaks. They are computed as:

Dmax_cb = max over m=0,...,M of (Qcb(m) - a_m) / b_m

where a_m and b_m are the 95th percentile and scale factor from the asymptotic
distribution. The Dmax statistic follows a Type I extreme value distribution.

Advantage: Dmax is valid across all possible numbers of breaks, so you
do not need to choose m.

Options

model(1|2) specifies the deterministic specification:

1 = Model I: mean shifts only (DU dummies). No trend. No Qct test.

2 = Model II: linear trend with intercept shifts. All tests available. Default.

maxbreaks(#) sets the maximum number of structural breaks to consider.
With maxbreaks(2), the command computes tests for m=0, 1, and 2 breaks and
reports the Dmax omnibus statistics. Default is 2.

klags(numlist) specifies the DOLS lag/lead values. Results are reported for
each value separately. Using multiple values allows assessing sensitivity of the
results to the bandwidth choice. Default is 1 3 5 7 9.

Guidance on choosing k:

- Larger k reduces bias from endogeneity but costs degrees of freedom

- With T=100, k=1 to 5 is reasonable; with T=250, k up to 9

- Results should be qualitatively similar across different k values

epsilon(real) sets the trimming fraction for the break date search.
Break dates are searched over [epsilon*T, (1-epsilon)*T]. Default is 0.15,
meaning the first and last 15% of observations are excluded.

plot produces diagnostic plots:

(1) Bar charts of Qr, Qcb, Qct statistics across lag specs with CV lines

(2) Time series plot with estimated break dates marked

(3) Combined dashboard

notable suppresses output tables (results still stored in e()).

saving(string) specifies a filename stem for saving plots as PNG files.

noisily displays detailed progress during Mata computation.

How to Interpret the Results

The following decision tree helps interpret the test results:

Step 1: Look at the Qr test across all lag specifications.

If Qr is NOT significant (Qr < CV): Cointegration holds.
The variables share a long-run equilibrium. Proceed to Step 2.

If Qr IS significant (Qr > CV): No cointegration.
The variables do not share a long-run equilibrium. The analysis stops here.

Step 2: (If CI holds) Look at the Qcb test.

If Qcb is NOT significant: Cobreaking holds.
The structural breaks cancel in the equilibrium. The long-run relationship
is free of structural breaks, making it more reliable for forecasting.

If Qcb IS significant: Cobreaking fails.
Although cointegration holds, the structural breaks do NOT cancel. The
equilibrium relationship itself is subject to regime changes.

Step 3: (If CI holds, Model II only) Look at the Qct test.

If Qct is NOT significant: Cotrending holds.
The deterministic trends cancel. The equilibrium has no drift.

If Qct IS significant: Cotrending fails.
The equilibrium has a non-zero drift (trend in the residuals).

Step 4: Look at Dmax for robustness.

Dmax provides a check that does not depend on the assumed number of breaks.
If Dmax is significant while the individual Q tests are borderline, the
overall evidence against the null is stronger.

Interpreting Break Dates

The estimated break dates are reported as both calendar dates and fractions
(pi = Tb/T). Break dates are estimated under the null of cointegration,
so they represent the most likely locations of structural breaks in the
deterministic component of the cointegrating relationship.

Robustness check: If the estimated break dates are stable across different
lag specifications (k), this provides stronger evidence for the break locations.
If dates shift substantially, the break evidence is weaker.

Significance Stars

Stars are assigned based on asymptotic critical values from the paper:

*** = significant at 1% level (strong evidence against H0)

** = significant at 5% level (moderate evidence against H0)

* = significant at 10% level (weak evidence against H0)

Data Requirements and Assumptions

Required Data Structure

1. Time-series data: The dataset must be tsset with a time variable.
Panel data is not supported.

2. I(1) variables: Both the dependent and independent variables should be
integrated of order one (unit root). Run dfuller or pperron
first to verify.

3. Minimum sample size: At least 50 observations. With T < 100, use
smaller k values. The paper uses T = 254 (quarterly data).

4. Regressors: 1 or 2 stochastic (I(1)) regressors (px = 1 or 2).

Key Assumptions

1. I(1) variables: All variables must be non-stationary with a unit root.
If variables are I(0), use standard regression methods instead.

2. At most 2 breaks: The current implementation supports 0, 1, or 2
structural breaks. If you suspect more breaks, the test may not detect them.

3. Break type: Breaks are in the deterministic component only (level shifts
or intercept shifts). The cointegrating slope coefficient beta is assumed
constant across regimes.

4. Single equation: The command estimates a single cointegrating equation.
For systems with multiple cointegrating vectors, use vecrank.

5. No I(2) variables: Variables integrated of order 2 or higher are not
handled. First-difference such variables before use.

Pre-testing Recommendations

Before running cobreakcoint, we recommend:

(a) Test each variable for unit roots: dfuller y, lags(4)
and dfuller D.y, lags(4) to confirm I(1).

(b) Plot the series to visually identify potential break dates
and assess whether Model I or Model II is appropriate.

(c) For trending data, use Model II. For mean-reverting data with
possible level shifts, use Model I.

Examples

Example 1: US Government Budget Sustainability

This example replicates the empirical application from the original paper.
The data contains quarterly US government expenditures and revenues as
percentages of GDP from 1947:Q1 to 2010:Q2 (T = 254).

Research question: Is US fiscal policy sustainable? That is, do government
expenditures (E) and revenues (R) share a long-run equilibrium (cointegration)?
And if so, do the structural breaks (e.g., Great Society, Reagan tax cuts)
cancel in the equilibrium (cobreaking)?

. * Load bundled dataset

. use USbudget.dta, clear

. * Verify unit roots

. dfuller E, lags(4)

. dfuller R, lags(4)

. * Both should fail to reject H0 of unit root

. * Run Model II (appropriate for trending GDP ratios)

. cobreakcoint E R, model(2) maxbreaks(2) klags(1 3 5 7 9)

Expected results and interpretation:

Qr(1) ranges from 13-15 across lags, all *** significant.
Interpretation: Reject H0 of cointegration. This means E and R do NOT
cointegrate — fiscal policy is not sustainable in the conventional sense.

Qcb(1) ranges from 17-18, all ** significant.
Interpretation: The joint hypothesis of CI + CB is also rejected.

Qct(1) ranges from 22-33, all significant.
Interpretation: The joint hypothesis of CI + CT + CB is also rejected.

Break dates: m=1 break around 1996q1 (pi=0.78), m=2 breaks around
1966q3 and 1996q1. These correspond to the mid-1960s fiscal expansion
and the mid-1990s budget surplus era.

Example 2: With diagnostic plots

. cobreakcoint E R, model(2) maxbreaks(2) plot saving(budget)

This produces bar charts of all test statistics with critical value reference
lines, time series with estimated break dates marked, and a combined dashboard.

Example 3: Model I — Mean shifts only

. cobreakcoint E R, model(1) maxbreaks(2) klags(1 3 5 7 9)

Model I assumes no deterministic trend, only level shifts. The Qct test is
not available. Use this when the data does not exhibit a clear linear trend.

Example 4: Custom lag specification

. cobreakcoint E R, model(2) klags(2 4 6 8) maxbreaks(1)

Only search for 0 or 1 break with even lag/lead values. Faster computation.

Example 5: Accessing stored results

. cobreakcoint E R, model(2) maxbreaks(2) klags(1 3)

. matrix list e(TestM) // all test statistics

. matrix list e(ACV5) // 5% critical values

. matrix list e(Bmat) // break dates (obs numbers)

. matrix list e(Bfrac) // break fractions

. display e(model) // model number

. display e(T) // sample size

. ereturn list // all stored results

Example 6: Using your own data

. * Load your time series data

. use mydata.dta, clear

. tsset time_variable

. * Check unit roots first

. dfuller y, lags(4)

. dfuller x, lags(4)

. * Run tests

. cobreakcoint y x, model(2) maxbreaks(2) klags(1 3 5 7)

Stored results

cobreakcoint stores the following in e():

Scalars

e(T) number of observations

e(px) number of stochastic regressors

e(model) model type (1 or 2)

e(maxbreaks) maximum breaks tested

e(nk) number of lag/lead specifications

Matrices

e(TestM) nk x 12 matrix of test statistics:

Columns 1-3: Q01, Q02, Q03 (m=0 known break tests: Qr, Qcb, Qct)

Columns 4-6: Q11, Q12, Q13 (m=1 unknown break tests)

Columns 7-9: Q21, Q22, Q23 (m=2 unknown break tests)

Column 10: Dmax_cb (Double-max for cobreaking)

Column 11: Dmax_ct (Double-max for cotrending)

Column 12: k (DOLS lags/leads value)

e(ACV5) 1 x 12 vector of 5% asymptotic critical values

e(Bmat) nk x 6 matrix of estimated break dates (obs numbers)

e(Bfrac) nk x 5 matrix of estimated break fractions (Tb/T)

Macros

e(cmd) cobreakcoint

e(cmdline) full command as typed

e(depvar) dependent variable name

e(indepvars) independent variable names

e(klags) DOLS lags/leads specification

e(modtype) model type description

Author

Dr. Merwan Roudane

Email: merwanroudane920@gmail.com

Acknowledgements

This command is a faithful Stata/Mata translation of the original MATLAB code
accompanying "Quasi-likelihood ratio tests for cointegration, cobreaking,
and cotrending" published in Econometric Reviews, 2019, 38(1), 43-61.

The test methodology and asymptotic critical values are from the original paper.
The DOLS correction follows Saikkonen (1991). The long-run variance estimator
uses the Quadratic Spectral kernel with Andrews (1991) bandwidth.

The bundled dataset (USbudget.dta) contains quarterly US government revenues
and expenditures as percentages of GDP, 1947:Q1 to 2010:Q2 (T = 254), sourced
from the NIPA tables of the Bureau of Economic Analysis (BEA).

Also see

Help: dfuller, pperron, vecrank,
zandrews, cupfm