*! version 1.2 16may2026

Title

threshcoint -- Threshold cointegration tests and models for Stata

Syntax

Each individual command is callable as tc_<name> (for example
tc_es, tc_glsmtar, tc_tvecm).
All commands are rclass -- results are returned in r().

Description

threshcoint is a Stata implementation of every major threshold
cointegration test and model from the econometrics literature. All
numerics run in Mata. No bootstrap is required for the tabulated tests --
asymptotic / finite-sample critical values are bundled.

The library is a direct port of the Python threshcoint library by
Dr Merwan Roudane and consolidates methods from twelve academic papers
and three R packages (tsDyn, NonlinearTSA, plus the original
supF.r script).

Unit-root and linear cointegration tests

tc_adf Augmented Dickey-Fuller unit-root test

tc_pp Phillips-Perron unit-root test

tc_eg Engle-Granger residual-based cointegration test

Threshold cointegration tests

tc_es Enders & Siklos (2001) TAR / MTAR

tc_glsmtar Cook (2007) GLS-MTAR

tc_exes Extended Enders-Siklos (Osinska & Galecki 2022)

tc_covaug Covariates-augmented (Oh, Lee & Meng 2017)

tc_bf Balke-Fomby (1997) sup-Wald

tc_adlbdm Li & Lee (2010) ADL-BDM

tc_adlbo Li & Lee (2010) ADL-BO (Boswijk)

tc_sysadl Li (2016) system-equation ADL

tc_supf Schweikert (2019) supF* with structural break

tc_hs Hansen-Seo (2002) supLM (linear vs threshold VECM)

tc_kss KSS (2006) nonlinear cointegration (ESTAR)

tc_bbc Bec-Ben Salem-Carrasco (2004) unit root vs SETAR

Threshold models

tc_tar TAR / MTAR model fit on cointegrating residuals

tc_eqtar EQ-TAR / Band-TAR / RD-TAR (3-regime Balke-Fomby)

tc_setar SETAR(2) self-exciting threshold AR

tc_tvecm TVECM -- Threshold Vector Error-Correction Model

Utilities

tc_compare Run a panel of tests and print a comparison table

tc_plot Regime, grid-search and ECT visualizations

Visualization

tc_plot regime resvar [, threshold(#) model(tar|mtar) title() saving()]

tc_plot grid [, title() saving()]

tc_plot ect ectvar [, threshold(#) title() saving()]

Examples

use https://www.stata-press.com/data/r17/lutkepohl2.dta, clear

tsset qtr

tc_adf ln_inv, case(c)

tc_eg ln_inv ln_inc, case(c)

tc_es ln_inv ln_inc, model(mtar) maxlag(6)

tc_glsmtar ln_inv ln_inc, case(c)

tc_supf ln_inv ln_inc, breaktype(4) maxlag(4) model(tar)

tc_hs ln_inv ln_inc, lag(2)

tc_tvecm ln_inv ln_inc, lag(1)

tc_compare ln_inv ln_inc, maxlag(6)

tc_plot grid

Stored results

All commands store results in r():

r(stat) / r(phi_stat) / r(f_star) / ... primary test statistic

r(rho1), r(rho2) regime-specific adjustment coefficients

r(threshold) estimated or specified threshold

r(lags) selected lag order

r(nregime1), r(nregime2) observations per regime

r(cv) row vector of critical values (cv01, cv05, cv10)

r(grid_values), r(grid_stats) grid for sup-type tests

r(coint_vec) cointegrating vector (tc_eg)

r(ect) lagged ECT vector (tc_tvecm)

References

Balke N.S. & Fomby T.B. (1997). Threshold cointegration. Int. Econ. Review 38, 627-645. (tc_bf)

Bec F., Ben Salem M. & Carrasco M. (2004). Tests for unit-root versus threshold specification. JBES 22(4). (tc_bbc)

Cook S. (2007). A threshold cointegration test with increased power. Math & Comput. Simul. 73, 386-392. (tc_glsmtar)

Enders W. & Siklos P.L. (2001). Cointegration and threshold adjustment. JBES 19(2), 166-176. (tc_es)

Hansen B.E. & Seo B. (2002). Testing for two-regime threshold cointegration in VECMs. J. Econometrics 110, 293-318. (tc_hs)

Kapetanios G., Shin Y. & Snell A. (2006). Testing for cointegration in nonlinear STAR ECM. Econometric Theory 22, 279-303. (tc_kss)

Li J. & Lee J. (2010). ADL tests for threshold cointegration. J. Time Series Analysis 31, 241-254. (tc_adlbdm, tc_adlbo)

Li J. (2016). System-equation ADL test for threshold cointegration. OBES. (tc_sysadl)

Oh D.Y., Lee H. & Meng M. (2017). More powerful threshold cointegration tests. Empirical Economics. (tc_covaug)

Osinska M. & Galecki J. (2022). Extended Enders and Siklos test. Statistical Review 69(1), 1-20. (tc_exes)

Schweikert K. (2019). Testing for cointegration with threshold adjustment in the presence of structural breaks. SNDE. (tc_supf)

Author

Dr Merwan Roudane

Email: merwanroudane920@gmail.com

GitHub: merwanroudane/threshcoint