*! version 1.0.1 16may2026

Title

ralsbattery -- One-shot battery of every RALS unit-root test on a single series

Navigation

Overview |
adf |
lm |
lm-breaks |
f-adf |
f-kss |
battery |
coint |
f-adl |
diag

Syntax

ralsbattery varlist [if] [in] [,
trend
maxlags(#)
ic(string)
fmax(#)
graph]

varlist may contain one or more time series.

Description

ralsbattery is the one-shot driver that runs everything in the rals
package on the supplied series:

1. For each variable in varlist, a unit-root mini-battery is
run -- ralsdiag, then RALS-ADF,
RALS-LM, RALS-Fourier ADF,
RALS-Fourier KSS and RALS-LM with one endogenous
break (model 2).

2. If varlist contains two or more series, a cointegration
battery is run on (dep = first variable, regressors = the rest): the four
single-equation tests of ralscoint (ECM, ADL, EG, EG2) plus
ralsfadl (Fourier ADL).

Each test prints one line in a unified table (stat, 5% CV at stage-1; stat,
5% CV, rho^2 at stage-2; verdict). The end-of-run summary reports how many
tests reject the null at 5% across the whole package, and the optional
graph draws a forest plot of every RALS statistic against its critical
value, colour-coded by reject / no reject.

Options

trend include a linear trend in every test. Without this only a
constant is fitted (where each test supports it).

maxlags(#) maximum lag used by each test's lag-selection
procedure (default 8).

ic(string) information criterion used to pick the lag:
aic | bic | tstat (default).

fmax(#) maximum Fourier frequency searched by the Fourier-augmented
tests (default 5).

graph draws a forest plot of each RALS statistic with its 5%
critical value, color-coded by reject / no-reject.

saving(filename) reserved for a future export of the result
matrix to a CSV/Excel file.

Examples

Unit-root only -- one series:

. sysuse sp500, clear

. gen t = _n

. tsset t

. ralsbattery close, trend graph

Multiple variables -- unit-root for each + cointegration battery:

. ralsbattery close volume open, trend graph

Stored results

ralsbattery stores the following in r():

r(unitroot) stacked matrix: 5 rows per variable, columns =
stage-1 stat, stage-1 5% CV, RALS stat, RALS 5% CV, rho^2, stage-1 reject,
RALS reject, extra (k or break date)

r(coint) (if varlist has ≥ 2 vars) 5x5 matrix of cointegration
results (ECM/ADL/EG/EG2/Fourier-ADL)

r(n_rej_rals) total RALS rejections across all variables

r(n_tests) total RALS unit-root tests run

r(n_coint_rej) RALS cointegration rejections (if applicable)

r(T) sample size used

r(variables) variable list

See also

Back to overview: rals

Individual tests: ralsadf, ralslm, ralslmb, ralsfadf, ralsfkss

Cointegration tests: ralscoint, ralsfadl

Diagnostics: ralsdiag

Author

Dr Merwan Roudane -- merwanroudane920@gmail.com