*! version 1 20nov2016
help ersur (SJ18-1: st0508_1)

Title

ersur -- Calculate Elliott, Rothenberg, and Stock (1996)
unit-root test statistic along with 1%, 5%, and 10% finite-sample critical values and associated p-values

Syntax

ersur varname [if] [in] [, noprint
maxlag(integer)
trend]

by is not allowed. The routine may be applied to a single unit of a panel.

You must tsset your data before using ersur; see [TS] tsset.

varname may contain time-series operators; see tsvarlist.

Sample may not contain gaps.

Description

ersur computes Elliott, Rothenberg, and Stock (1996) generalized
least squares (GLS)-detrending-based unit-root tests against the alternative
of stationarity. The command accommodates varname with nonzero mean and
nonzero trend. Allowance is also made for the lag length to be either fixed or
determined endogenously using information criteria such as Akaike and Schwarz,
denoted AIC and SIC, respectively. A data-dependent procedure often known as
the general-to-specific (GTS) algorithm is also permitted, using significance
levels of 5% and 10%, denoted GTS05 and GTS10, respectively; see, for example,
Hall (1994). Approximate p-values are also calculated.

Both the finite-sample critical values and the p-value are estimated based on
an extensive set of Monte Carlo simulations, summarized by means of response
surface regressions; for more details, see Otero and Baum (2017).

Options

noprint specifies that the results be returned but not printed.

maxlag(integer) sets the number of lags to be included in the test
regression to account for residual serial correlation. By default,
ersur sets the number of lags following Schwert (1989), with the formula
maxlag()=int{12*(T/100)^0.25}, where T is the total number of
observations.

trend specifies the modeling of intercepts and trends. By default,
ersur considers varname to be a nonzero mean stochastic process;
in this case, Elliott, Rothenberg, and Stock (1996) recommend demeaning the data using GLS. If the trend
option is specified, ersur assumes that varname is a nonzero trend
stochastic process, in which case Elliott, Rothenberg, and Stock recommend detrending the data using GLS.

Examples

We illustrate the use of ersur by examining the time-series properties of interest rate spreads, defined as the differences between long-term and short-term interest rates.
The data, which are freely available from the Federal Reserve Economic Data of the Federal Reserve Bank of St. Louis, cover the period between 1993m10 and 2013m3,
for a total of T = 234 time observations for each series.

We begin by using the data and verifying that they have a time-series format. If needed, install bcuse from the SSC Archive.

. bcuse usrates

. tsset date

Then, suppose we want to test whether the interest rate spread
between r6 and r3 (which we shall denote as s6) contains a
unit root against the alternative, that it is a stationary process. Given
that s6 has a nonzero mean, the relevant ERS statistic is that based on
GLS demeaned data, which is implemented by default. Initially, the number of
lags is set by the user as p=3.

. ersur s6, maxlag(3)

This second illustration is the same as above, but using a subsample of the
data that starts in January 1997:

. ersur s6 if tin(1997m1,), maxlag(3)

We can perform the ERS test using all the available observations, but with
the number of lags determined based on Schwert's formula:

. ersur s6

Finally, we can also work with a long form of the data, in which a single variable s contains all interest rate spreads, and the sample is restricted to one specific spread:

First, rename the variables so that they are in a suitable format to apply the command reshape; see [D] reshape:

. rename r*m r*

. reshape long r s, i(date) j(matdiff)

Next, declare the dataset as a panel using xtset; see [XT] xtset:

. xtset matdiff date

Lastly, apply the command

. ersur s if matdiff==6, maxlag(3)

Stored results

ersur stores the following in r():

Scalars

r(N) number of observations

r(minp) first time period used in the test regression

r(maxp) last time period used in the test regression

Macros

r(varname) variable name

r(treat) demeaned or detrended, depending on the trend option

r(tsfmt) time-series format of the time variable

Matrices

r(results) results matrix, 5 x 6

The rows of the results matrix indicate which method of lag length was used: FIX (lag selected by user or using Schwert's formula), AIC, SIC, GTS05, or
GTS10.

The columns of the results matrix contain, for each method: the number of lags
used, the ERS statistic, its p-value, and the critical values at 1%, 5%, and
10%, respectively.

References

Elliott, G., T. J. Rothenberg, and J. H. Stock. 1996. Efficient tests for an autoregressive unit root. Econometrica 64: 813-836.

Hall, A. 1994. Testing for a unit root in time series with pretest data-based model selection. Journal of Business and Economic Statistics 12: 461-470.

Otero, J., and C. F. Baum. 2017.
Response surface models for the Elliott, Rothenberg, and Stock unit-root test.
Stata Journal 17: 985-1002.

Schwert, G. W. 1989. Tests for unit roots: A Monte Carlo investigation. Journal of Business and Economic Statistics 7: 147-159.

Authors

Jesús Otero

Universidad del Rosario

Bogotá, Colombia

jesus.otero@urosario.edu.co

Christopher F. Baum

Boston College

Chestnut Hill, MA

baum@bc.edu

Also see

Article: Stata Journal, volume 18, number 1: st0508_1,

Stata Journal, volume 17, number 4: st0508