*! version 1.0.0 24jun2026

Title

maki -- Maki (2012) cointegration test with unknown number of breaks

Syntax

maki depvar indepvars [if] [in],
nbreaks(#)
[model(#)
trimming(#)
lagoption(#)
reg
regnewey]

The data must be tsset-declared as a single (non-panel) time series.

Required
nbreaks(#) maximum number of breaks, an integer between 1 and 5

Optional
model(#) deterministic specification; 0, 1, 2, or 3; default is model(2)

trimming(#) trimming fraction in (0,0.5); default is trimming(0.10)

lagoption(#) augmentation-lag rule; 0, 1, 2, or 3; default is lagoption(1)

maxlag(#) maximum augmentation lag for lagoption(1) and lagoption(2); default is maxlag(12)

reg estimate the cointegrating regression at the selected breaks by OLS; the required dummy variables (mk_*) will be automatically generated and added to the dataset

regnewey as reg, but with Newey-West (HAC) standard errors

Description

maki performs the residual-based cointegration test of Maki (2012), which
allows the cointegrating relationship to have an unknown number of structural
breaks, smaller than or equal to a maximum number of breaks k set a priori.
The procedure combines the sequential break-search idea of Bai and Perron (1998)
with the unit-root testing strategy of Kapetanios (2005).

The null hypothesis is no cointegration; the alternative is cointegration with
i breaks (i k). For each candidate set of breaks the test
estimates the regression by OLS, runs an ADF-type regression on the residuals,
and records the t-statistic for the residual unit-root coefficient. The
test statistic is the minimum t-statistic over all the partitions searched
up to k breaks. Large negative values lead to rejection of the no-
cointegration null. Breakpoints are selected by minimizing the sum of squared
residuals (SSR).

This command is a Stata/Mata port of the original GAUSS
procedures written by Daiki Maki and distributed in the TSPDLIB library
(Aptech Systems). The first regressor in indepvars through the fourth is
supported; critical values are available for up to four regressors only.

The four deterministic specifications correspond to Maki (2012, Eq1-Eq4).
In all of them D(i,t) = 1 if t > TB(i) and 0 otherwise, where
TB(i) is the i-th break date; mu is the intercept, gamma the trend coefficient,
beta the cointegrating slope vector, and u(t) the equilibrium error. The sums
run over i = 1, ..., k breaks.

model(0) - Level shift, Maki (2012, Eq1). Breaks shift only the intercept:

y(t) = mu + sum_i mu(i)*D(i,t) + beta'x(t) + u(t)

model(1) - Level shift with trend, Maki (2012, Eq2). A deterministic trend is
added; breaks shift only the intercept:

y(t) = mu + sum_i mu(i)*D(i,t) + gamma*t + beta'x(t) + u(t)

model(2) - Regime shift, Maki (2012, Eq3). Breaks shift both the intercept and the
slope coefficients (this is the default):

y(t) = mu + sum_i mu(i)*D(i,t) + beta'x(t) + sum_i (beta(i)'x(t))*D(i,t) + u(t)

model(3) - Regime shift with trend, Maki (2012, Eq4). Breaks shift the intercept,
the trend, and the slope coefficients:

y(t) = mu + sum_i mu(i)*D(i,t) + gamma*t + sum_i gamma(i)*t*D(i,t) + beta'x(t) + sum_i (beta(i)'x(t))*D(i,t) + u(t)

With reg or regnewey these are exactly the regressions estimated at
the selected break dates: the regime dummies are the mk_dui terms, the
slope interactions are the mk_dui_x terms, and, under
model(3), the trend interactions are the mk_dtri terms.

The data must contain no missing values over the estimation sample; restrict the
sample with if / in or keep before running the command. The
break points are reported as the observation number, the corresponding value of
the tsset time variable (Date), and the break fraction.

Because the critical values in Maki (2012, Table 1) depend on the model, the
number of regressors, the maximum number of breaks, and the trimming parameter,
they are tabulated only for trimming(0.05) in the source paper. The
critical values returned here reproduce those of the TSPDLIB GAUSS routine
exactly. Interpret rejections with this in mind when using a different trimming
value.

Options

nbreaks(#) sets the maximum number of breaks k. Must be an integer
from 1 to 5. As noted by Maki (2012), the case nbreaks(1) is consistent
with the models of Gregory and Hansen (1996), and nbreaks(2) is similar
to the models of Hatemi-J (2008).

model(#) selects the deterministic terms entered in the cointegrating
regression; the four specifications and their equations are listed under
Description. The default model(2)
is the regime-shift model.

trimming(#) is the fraction of the sample trimmed at each end of every
break search, to exclude breaks at the very beginning or end of the sample and
breaks in consecutive periods. Must lie strictly between 0 and 0.5. The default
is 0.10. Note that the internal region-eligibility thresholds for three or more
breaks are fixed at 0.1T and 0.9T as in the original GAUSS code and do
not change with this option.

lagoption(#) chooses the augmentation lag in the residual ADF regression:

0 no augmentation (lag = 0).

1 t-significance ("t-sig") rule, general-to-specific from the
maximum lag set by maxlag() (default 12), with the last retained lag
significant at the |t| > 1.654 threshold. This is the default.

2 Breusch-Godfrey ("BG") rule, general-to-specific: starting
from the maximum lag set by maxlag() and stepping down, the augmentation
lag at which the residuals of the ADF regression first show no serial
correlation, judged by the Breusch-Godfrey LM test at the 5% level. The BG test
is run for orders 1 to a horizon set by the data frequency (annual 2, quarterly
8, monthly 24, weekly 52, daily 100), and a lag is treated as clean only if the
test does not reject for any of those orders. If autocorrelation cannot be
eliminated even at the maximum lag, a warning is issued. This rule is an addition
to the command and is not part of the original GAUSS source.

3 fixed: uses exactly maxlag() lags, with no
selection. This rule is an addition to the command and is not part of the
original GAUSS source.

maxlag(#) sets the maximum augmentation lag for the lag rules in
lagoption(1) and lagoption(2), and the exact number of lags used by
lagoption(3). It must be a positive integer and defaults to 12 (the value
hard-coded in the GAUSS source). Under
lagoption(0) it has no effect. Increase it when the Breusch-Godfrey rule
reports that autocorrelation could not be eliminated at the current maximum.

reg estimates, after the test, the cointegrating regression implied by the
selected break dates and reports it with Stata's regress (OLS).
The regressors reproduce the deterministic specification of the chosen
model(): regime dummies that switch on after each estimated break, the
regressors in indepvars, and, for the regime-shift models, the break-by-
regressor interactions (and break-by-trend interactions under model(3)).
The dummies are built from the break dates that produced the test statistic, so
the OLS residuals coincide with those underlying the reported t-statistic.
A line showing how to reproduce the regression directly is printed. The
required dummy variables (mk_*) will be automatically generated and added
to the dataset.

regnewey does the same as reg but reports Newey-West
heteroskedasticity- and autocorrelation-consistent (HAC) standard errors via
newey. The lag truncation is set automatically to
floor(4*(T/100)^(2/9)). Specify reg or regnewey, not both.

Examples

Nelson-Plosser data, money-demand-type relationship, 1909-1970

. use "https://eruygurakademi.com/datasets/maki/nelsonplosser.dta", clear

. keep if year >= 1909

. tsset year

Regime-shift model, up to two breaks:

. maki lgnp lm bnd, nbreaks(2) model(2)

Up to three breaks, regime shift with trend:

. maki lgnp lm bnd, nbreaks(3) model(3)

Single break, level-shift model, no lag augmentation:

. maki lgnp lm bnd, nbreaks(1) model(0) lagoption(0)

Regime-shift model with Breusch-Godfrey lag selection:

. maki lgnp lm bnd, nbreaks(3) model(2) lagoption(2)

Two regressors, five breaks, tighter trimming:

. maki lgnp lm, nbreaks(5) model(2) trimming(0.05)

Show the cointegrating regression at the selected breaks (OLS):

. maki lgnp lm bnd, nbreaks(5) model(2) reg

Same, with Newey-West (HAC) standard errors:

. maki lgnp lm bnd, nbreaks(5) model(2) regnewey

Comparison with the makicoint command (if installed). maki
reproduces the result of the original GAUSS TSPDLIB coint_maki procedure:

. maki lgnp lm bnd, nbreaks(5) model(2)

. makicoint lgnp lm bnd, maxbreaks(5) model(2)

GAUSS replication

maki is a Stata/Mata port of the TSPDLIB GAUSS procedure
coint_maki and reproduces it to the displayed precision. The two commands
correspond as follows:

Stata:

maki depvar indepvars, nbreaks(m) model(M)

GAUSS:

call coint_maki(data, m, M);

m = nbreaks() is the second GAUSS argument and M = model()
is the third. In coint_maki the data matrix has the dependent variable in
its first column and the regressors in the remaining columns, matching
depvar indepvars here. Trimming and lag selection use the same defaults
in both (trimming(0.10) and the t-significance lag rule), so omitting them
in GAUSS reproduces the maki default.

Ready-to-run replication files for both packages are provided at
https://eruygurakademi.com/datasets/maki/.
Each file runs the same 20 specifications (the four models, each with a maximum
of one through five breaks) on the Nelson-Plosser data, so the Stata and GAUSS
output can be compared side by side.

Replicating in Stata

The do-file
maki_stata.do
loads the data, sets the sample, and runs all 20 specifications. Run it directly
from the web with:

. do https://eruygurakademi.com/datasets/maki/maki_stata.do

Replicating in GAUSS

The program
maki_gauss.gss
reads the data directly from the web and runs all 20 specifications, so no
manual download of the data is needed. To run it:

1. Make sure the TSPDLIB library is installed in GAUSS.

2. Open
maki_gauss.gss
in GAUSS, select the entire program with Ctrl+A, and press Run.

GAUSS then prints the test statistic, critical values, estimated break dates,
and the test conclusion for all 20 specifications, matching the Stata output.

Stored results

maki stores the following in r():

Scalars

r(test_stat) minimum t-statistic (the test statistic)

r(cv1) 1% critical value

r(cv5) 5% critical value

r(cv10) 10% critical value

r(reject) 1 if H0 rejected at the 10% level or better, 0 otherwise

r(nobs) number of observations used

r(nbreaks) maximum number of breaks

r(model) model number

r(trimming) trimming fraction

r(sel_lag) augmentation lag of the ADF regression that produced the test statistic

r(bpi) observation number of break i

r(bpdatei) time-variable value at break i

r(bpfraci) break fraction of break i

Macros

r(depvar) dependent variable

r(indepvars) independent variable(s)

r(model_name) model description

References

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

Hatemi-J, A. 2008. Tests for cointegration with two unknown regime shifts with
an application to financial market integration. Empirical Economics 35:
497-505.

Kapetanios, G. 2005. Unit-root testing against the alternative hypothesis of up
to m structural breaks. Journal of Time Series Analysis 26: 123-133.

Maki, D. 2012. Tests for cointegration allowing for an unknown number of breaks.
Economic Modelling 29: 2011-2015.

Author

H. Ozan Eruygur

AHBV University, Ankara, Turkiye.

Department of Economics

https://www.ozaneruygur.com

eruygur@gmail.com

Eruygur Academy and Consulting (Eruygur Akademi ve Danismanlik), Ankara, Turkiye.

https://www.eruygurakademi.com

eruygurakademi@gmail.com

maki v3.5.0 - June 2026

The test implemented here was proposed by Daiki Maki (Faculty of Economics,
Ryukoku University, Kyoto, Japan) in Maki (2012). maki is a Stata/Mata
port of the original GAUSS code, which was provided by Daiki Maki himself (by
email, October 2019) and modified by Jason Jones (Aptech Systems), and
distributed in the TSPDLIB library by Saban Nazlioglu.

Please cite as:

Eruygur, H. O. 2026. maki: Maki (2012) cointegration test with unknown
number of breaks. Stata package version 3.5.0. Available from:
https://www.eruygurakademi.com.