*! version 1.0.0 08feb2026

Title

cointsmall -- Testing for cointegration with structural breaks in very small samples

Syntax

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

Main
breaks(#) number of structural breaks (0, 1, or 2); default is breaks(1)

model(string) model specification: o (no break), c (break in constant),
or cs (break in constant and slope); default is cs if breaks > 0

criterion(string) break date selection criterion: adf (minimize test statistic)
or ssr (minimize sum of squared residuals); default is adf

Optional
combined perform combined testing procedure across all model specifications

trim(#) trimming parameter for break date search; default is trim(0.15)

maxlags(#) maximum number of lags for ADF test;
default is int(12*(T/100)^0.25)

level(#) set confidence level; default is level(95)

detail display detailed regression output

depvar and indepvars must be time series variables.

You must tsset your data before using cointsmall; see tsset.

Description

cointsmall implements the cointegration test with endogenous structural breaks
designed for very small sample sizes (T < 50) proposed by Trinh (2022). The test extends
the Gregory and Hansen (1996) procedure to allow for up to two structural breaks and
provides size-corrected critical values specifically computed for small samples.

The test is particularly useful for:

• Analyzing macroeconomic data from emerging economies with limited data history

• Testing cointegration relationships with less than 50 annual observations

• Detecting structural breaks in long-run relationships

• Situations where conventional cointegration tests have size distortions

The null hypothesis is no cointegration. The alternative hypothesis is cointegration
with or without structural breaks in the parameters. The test statistic is the minimum
ADF statistic (ADF*) computed over all possible break dates.

Options

Main

breaks(#) specifies the number of structural breaks to test for. Options are:

breaks(0) tests for cointegration without structural breaks (model o).
This is equivalent to the Engle-Granger residual-based test but with size-corrected
critical values for small samples.

breaks(1) tests for cointegration with one endogenous structural break.
The break date is selected to minimize the ADF statistic (if criterion(adf))
or the sum of squared residuals (if criterion(ssr)).

breaks(2) tests for cointegration with two endogenous structural breaks.
Both break dates are jointly selected using the specified criterion.

model(string) specifies the type of structural break:

model(o) specifies no structural break. Only the constant is included in the
cointegrating regression. This option is only compatible with breaks(0).

model(c) specifies a structural break in the constant (intercept) only.
The slope coefficients remain constant across regimes.

model(cs) specifies structural breaks in both the constant and slope coefficients.
This is the most general specification and is the default when breaks > 0.

criterion(string) specifies how break dates are selected:

criterion(adf) selects break date(s) that minimize the ADF test statistic.
This is the default and follows Gregory and Hansen (1996).

criterion(ssr) selects break date(s) that minimize the sum of squared residuals.
This follows Bai and Perron (1998) and focuses on model fit rather than test power.

Optional

combined performs a combined testing procedure that:

1. Tests all three model specifications (o, c, cs)

2. Identifies which models reject the null hypothesis

3. Selects the most appropriate model based on rejection patterns

This option is recommended when the true model specification is unknown.
It improves power by considering multiple alternatives while maintaining proper size.

trim(#) specifies the trimming parameter for the break date search.
Break dates are searched in the interval [trim*T, (1-trim)*T]. The default is 0.15,
meaning break dates must be at least 15% from the start or end of the sample.
This ensures sufficient observations in each regime for estimation.

maxlags(#) specifies the maximum number of lags to consider in the ADF regression.
The optimal lag length is selected using the Bayesian Information Criterion (BIC).
The default is int(12*(T/100)^0.25), following Schwert (1989).

level(#) specifies the confidence level, as a percentage, for critical values.
The default is level(95) for 5% significance level.
Only 95% (5% level) is currently supported.

detail displays detailed regression output including coefficient estimates
and standard errors for the final selected model.

Examples

Setup

. webuse lutkepohl2, clear

. tsset qtr

Basic test with one break, default options

. cointsmall dln_inv dln_inc dln_consump

Test with one break in constant only

. cointsmall dln_inv dln_inc dln_consump, breaks(1) model(c)

Test with two breaks in constant and slope

. cointsmall dln_inv dln_inc dln_consump, breaks(2) model(cs)

Test without structural breaks (Engle-Granger with size correction)

. cointsmall dln_inv dln_inc dln_consump, breaks(0)

Combined testing procedure (recommended for unknown specification)

. cointsmall dln_inv dln_inc dln_consump, breaks(1) combined

Use SSR criterion for break date selection

. cointsmall dln_inv dln_inc dln_consump, breaks(1) criterion(ssr)

Show detailed regression output

. cointsmall dln_inv dln_inc dln_consump, breaks(1) detail

Specify trimming and maximum lags

. cointsmall dln_inv dln_inc dln_consump, breaks(1) trim(0.20) maxlags(4)

Example with Chinese macroeconomic data (from Trinh 2022)

This example replicates the application in Trinh (2022) Section 7.

. * Load Chinese macroeconomic data (1989-2019)

. use chinese_macro.dta, clear

. tsset year

. * Test cointegration with 1 break

. cointsmall log_gdp log_retail log_investment, breaks(1) model(cs)

. * Compare with 2 breaks

. cointsmall log_gdp log_retail log_investment, breaks(2) model(cs)

. * Use combined procedure

. cointsmall log_gdp log_retail log_investment, breaks(1) combined detail

Stored results

cointsmall stores the following in r():

Scalars

r(T) number of observations

r(m) number of regressors

r(breaks) number of structural breaks

r(adf_stat) ADF* test statistic

r(lags) number of lags selected

r(cv) critical value at specified level

r(pval) p-value (approximate)

r(ssr) sum of squared residuals

r(break1) first break date (time variable value)

r(break2) second break date (if breaks=2)

r(break1_obs) first break observation number

r(break2_obs) second break observation number (if breaks=2)

Macros

r(model) model specification (o, c, or cs)

r(criterion) break selection criterion (adf or ssr)

When combined is specified, additional results are stored:

r(adf_o) ADF statistic for model o

r(adf_c) ADF statistic for model c

r(adf_cs) ADF statistic for model cs

r(cv_o) critical value for model o

r(cv_c) critical value for model c

r(cv_cs) critical value for model cs

r(reject_o) 1 if model o rejects null, 0 otherwise

r(reject_c) 1 if model c rejects null, 0 otherwise

r(reject_cs) 1 if model cs rejects null, 0 otherwise

r(selected_model) selected model from combined procedure

Technical notes

Sample size considerations:

The test is designed for very small samples (T < 50) where conventional cointegration
tests suffer from severe size distortions. The power of the test varies with:

• Sample size: Power increases with T

• Serial correlation: Lower serial correlation improves power

• Model specification: Correct specification is crucial

• Break magnitude: Larger breaks are easier to detect

From simulation evidence in Trinh (2022):

• For T ≥ 30 and low serial correlation (ρ < 0.4): Power > 75%

• For T = 30 with model o: Power ≈ 90%

• For T = 30 with model cs: Power ≈ 60-70%

Critical values:

Size-corrected critical values are computed using surface response functions
estimated from 10,000 Monte Carlo replications for each sample size. The critical
values account for the high rate of convergence of residual-based cointegration tests.

Critical values are available for:

• Sample sizes: T = 12 to 1,000

• Number of regressors: m = 1, 2, 3

• Number of breaks: b = 0, 1, 2

• Models: o, c, cs

Break date selection:

The ADF criterion (default) selects break dates to maximize the evidence against
the null hypothesis. This approach has better power properties than the SSR criterion,
particularly in small samples.

The SSR criterion focuses on model fit and may select different break dates.
It tends to be more conservative (less likely to reject the null).

Combined testing procedure:

The combined procedure tests all model specifications and uses a model selection
algorithm based on:

1. Which models reject the null hypothesis

2. Wald tests for parameter restrictions when multiple models reject

3. Parsimony principle when specifications are nested

This approach improves power while maintaining proper size, especially when the
true model specification is unknown.

Methods and formulas

The test statistic for b structural breaks is:

ADF* = inf ADF(ε̂)

where ε̂ are the residuals from:

Y = μ + X'β + Σ[i=1 to b] Di(μi + X'βi) + ε

and Di is a dummy variable equal to 1 for t ≥ ti.

The ADF test on residuals is:

Δε̂t = γε̂t-1 + Σ[j=1 to p] δjΔε̂t-j + ut

The test statistic is the t-statistic on γ. The optimal lag length p is selected
using the BIC criterion.

Critical values are computed using surface response functions:

CV(T,q,m,b,M) = ψ∞ + Σ[k=1 to K] ψk T^(-k)

where coefficients are estimated from Monte Carlo simulations.

References

Trinh, J. 2022. Testing for cointegration with structural changes in very small sample.
THEMA Working Paper n°2022-01, CY Cergy Paris Université.

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

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

Engle, R. F., and C. W. J. Granger. 1987. Co-integration and error correction:
Representation, estimation, and testing. Econometrica 55: 251-276.

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

MacKinnon, J. G. 1991. Critical values for cointegration tests. In
Long-Run Economic Relationships: Readings in Cointegration, ed. R. F. Engle and
C. W. J. Granger, 267-276. Oxford: Oxford University Press.

Author

Dr. Merwan Roudane

Independent Researcher

Email: merwanroudane920@gmail.com

Acknowledgments

This package implements the methodology developed by Jérôme Trinh in his 2022
working paper. The author thanks Professor Jérôme Trinh for making the research
publicly available.

Also see

Online: dfuller, pperron, vec, tsset