*! version 1.0.0 14may2026
help tarur

Title

tarur -- Nonlinear unit-root, cointegration, and linearity tests
with embedded critical values and automatic decisions.

Syntax

tarur subcommand varlist [if] [in] [, options]

Subcommands

Unit-root tests

kss KSS (2003) ESTAR test -- tNL

kruse Kruse (2011) modified Wald -- tau

sollis2009 Sollis (2009) AESTAR -- F_AE

sollis2004 Sollis (2004) ST-TAR -- F_TAR

huchen Hu & Chen (2016) -- tau(3p)

endersgranger Enders & Granger (1998) MTAR -- Phi

lnv Leybourne-Newbold-Vougas (1998) -- t_ADF

vougas Vougas (2006) -- 5 models -- t_ADF

harveymills Harvey & Mills (2002) -- t_ADF

cookvougas Cook & Vougas (2009) ST-MTAR -- F_MTAR

kilic Kilic (2011) inf-t (grid) -- inf-t

parkshintani Park & Shintani (2016) inf-t -- inf-t

pascalau Pascalau (2007) NLSTAR -- F

cuestasgarratt Cuestas & Garratt (2011) -- chi2

cuestasordonez Cuestas & Ordonez (2014) -- tNL

Cointegration tests

ksscoint KSS (2006) nonlinear cointegration -- tNL

enderssiklos Enders & Siklos (2001) TAR cointegration -- Phi

Linearity and diagnostics

terasvirta Terasvirta (1994) linearity -- F

arch Engle (1982) ARCH LM test -- LM

mcleodli McLeod-Li (1983) portmanteau -- Q

Battery

runall Run 11 unit-root tests at once, return r(results) matrix

Common options

case(string) raw | demeaned | detrended (default demeaned)

maxlags(#) maximum augmenting lag order (default 8)

lagmethod(s) aic | bic | tstat (default aic)

model(letter) letter model for LNV (A-C), Vougas (A-E), HM (A-C), Sollis2004 (A-C), CookVougas (A-D)

quietly suppress the formatted table; still return all r() scalars

Description

tarur provides a unified Stata interface to 20+ nonlinear unit-root,
cointegration, and linearity tests. Every test embeds the original paper's
critical values, computes automatic reject/fail-to-reject decisions at the
1%, 5%, and 10% levels, and prints a publication-style summary. The
tarur command is a dispatcher to one ado-file per test; you can also
call the individual commands directly (e.g.,
tarur_kss varname, case(demeaned) works the same as
tarur kss varname, case(demeaned)).

This is the Stata port of the Python tarur library
(https://pypi.org/project/tarur/). Algorithms are
line-for-line ports; results match the Python reference for the
polynomial-regressor tests. NLS-based detrending (LNV, Vougas, Harvey-Mills,
Sollis 2004, Cook-Vougas, Cuestas-Ordonez) uses a fixed smooth-transition
fit in Stata rather than full nonlinear least squares.

Saved results

Every unit-root and cointegration test saves the following in r():

r(stat) test statistic

r(cv1) r(cv5) r(cv10) critical values at 1, 5, 10 %

r(reject1) r(reject5) r(reject10) 0/1 decision flags

r(lag) lag order selected

r(case) deterministic specification used (macro)

r(test) test name (macro)

Test-specific extras: tarur kruse returns r(beta1),
r(beta2); tarur sollis2009 returns r(phi1), r(phi2),
r(Fas), r(Fas_p); tarur endersgranger returns
r(rho_pos), r(rho_neg), r(F_sym), r(F_sym_p);
tarur kilic/parkshintani return r(gamma);
tarur huchen returns r(beta3); etc.
tarur runall returns an 11-row matrix r(results) with columns
statistic | cv1 | cv5 | cv10 | lag | r5 | r10.

Examples

Create a 200-observation random walk and run KSS:

. clear all

. set obs 200

. set seed 42

. gen t = _n

. gen y = sum(rnormal())

. tarur kss y, case(demeaned)

Full nonlinear battery:

. tarur runall y, case(demeaned) maxlags(12) lagmethod(aic)

Specific tests:

. tarur kruse y, case(demeaned)

. tarur sollis2009 y

. tarur huchen y, case(demeaned)

. tarur vougas y, model(C) maxlags(12)

. tarur harveymills y, model(A)

. tarur kilic y

Linearity diagnostic before running ESTAR tests:

. tarur terasvirta y

Cointegration tests:

. gen x = sum(rnormal())

. gen y_coint = 0.7*x + rnormal()

. tarur ksscoint y_coint x, case(demeaned)

. tarur enderssiklos y_coint x

Stata version

Stata 14.0 or later.

Installation

From SSC (recommended once accepted)

. ssc install tarur, replace

. help tarur

SSC routes every file in the package to the user's PLUS adopath, with
files binned by their first character: the tarur* ado-files and
help file land in ~/ado/plus/t/, and the Mata helper
_tarur_mata.mata lands in ~/ado/plus/_/. findfile walks
the adopath, so tarur_init locates the Mata helper automatically.
No manual adopath setup is required for SSC users.

Local / development use

. adopath + "C:/path/to/tarur"

. tarur kss y, case(demeaned)

The + form appends to the end of the adopath, so an SSC-installed
copy in PLUS would still win — this is intentional and follows the best
practice in Baum (Stata tip on "A walk on the adopath"). Do NOT use
adopath ++ or copy the files into PERSONAL: PERSONAL occludes PLUS,
which means an older copy in PERSONAL would shadow any
ssc install tarur, replace you run later. To diagnose which copy
of a tarur command Stata is actually using, type which tarur
(or which tarur_kss).

After editing the source

After modifying any tarur_*.ado or _tarur_mata.mata file
in-place, run mata: mata clear (or tarur_init, force) once.
Stata's discard clears compiled programs but NOT Mata, so newly
edited Mata functions otherwise stay unloaded.

Author

Dr Merwan Roudane

merwanroudane920@gmail.com

github.com/merwanroudane/tarur

Citation

Roudane, M. (2026). TARUR: Nonlinear Unit Root Testing Library.
https://github.com/merwanroudane/tarur.

References

Cook, S. & Vougas, D. (2009). Applied Economics, 41(11), 1397-1404.

Cuestas, J.C. & Garratt, D. (2011). Applied Economics, 43(11), 1431-1437.

Cuestas, J.C. & Ordonez, J. (2014). Applied Economics Letters, 21(14), 969-972.

Enders, W. & Granger, C.W.J. (1998). JBES, 16(3), 304-311.

Enders, W. & Siklos, P.L. (2001). JBES, 19(2), 166-176.

Engle, R. (1982). Econometrica, 50(4), 987-1007.

Harvey, D.I. & Mills, T.C. (2002). J. Applied Statistics, 29(5), 675-683.

Hu, J. & Chen, Z. (2016). Economics Letters, 146, 89-94.

Kapetanios, G., Shin, Y. & Snell, A. (2003). J. Econometrics, 112(2), 359-379.

Kapetanios, G., Shin, Y. & Snell, A. (2006). Econometric Theory, 22(2), 279-303.

Kilic, R. (2011). Econometric Reviews, 30(3), 274-302.

Kruse, R. (2011). Statistical Papers, 52(1), 71-85.

Leybourne, S., Newbold, P. & Vougas, D. (1998). JTSA, 19(1), 83-97.

McLeod, A.I. & Li, W.K. (1983). JTSA, 4(4), 269-273.

Park, J.Y. & Shintani, M. (2016). Int. Economic Review, 57(2), 635-664.

Pascalau, R. (2007). Working paper.

Sollis, R. (2004). J. Time Series Analysis, 25(3), 409-417.

Sollis, R. (2009). Economic Modelling, 26(1), 118-125.

Terasvirta, T. (1994). JASA, 89(425), 208-218.

Vougas, D. (2006). Computational Statistics & Data Analysis, 51(2), 797-800.