*! version 1 28aug2017

help kssur

Title

kssur -- Calculate Kapetanios, Shin & Snell unit root test statistic along with 1, 5 and 10% finite-sample critical values, and associated p-values

Syntax

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

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

Before using kssur you must tsset your data; see [TS] tsset.

varname may contain time series operators; see [U] tsvarlist.

Sample may not contain gaps.

Description

kssur computes Kapetanios, Shin & Snell KSS (2003) OLS-detrending based unit root tests against the alternative of a globally stationary exponential smooth transition autoregressive (ESTAR) process.
The command accommodates varname with nonzero mean and nonzero trend. Allowance is also made for the lag length to be either fixed (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 e.g. 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, summarised by means of response surface regressions; for more details see Otero and Smith (2017).

Options

noprint specifies that the results are to be returned but not printed.

maxlag sets the number of lags to be included in the test regression to account for residual serial correlation.
If not specified, kssur 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.

noconstant specifies that the test will be applied to the raw data. Use noconstant when varname is a zero mean stochastic process.

trend specifies that OLS detrending is to be applied. Use trend when varname is a nonzero trend stochastic process, in which case KSS recommend detrending the data using OLS.

By default, varname is assumed to be a nonzero mean stochastic process.

Examples

We test whether coffee price differentials contain a unit root. For this, we use monthly price series of the four best known types of coffee, namely unwashed Arabicas (mainly coffee from Brazil), Colombian mild Arabicas (mainly coffee
from Colombia), other mild Arabicas (mainly coffee from other Latin American countries), and Robusta coffee (mainly coffee grown in African countries and south-east Asia). The coffee prices, denoted br, co, om and ro, respectively,
are considered after applying the logarithmic transformation. The sample period runs from 1990m1 to 2004m1, that is a total of 169 time observations for each series, and the data were downloaded from the website
of the International Coffee Organisation (ICO) at www.ico.org.

We begin by downloading the data and verifying that it has a time-series format:

. use http://www2.warwick.ac.uk/fac/soc/economics/staff/jsmith/research/coffeedata.dta, clear

. tsset date

Then, let us say that we would like to test whether the price differential between Brazilian coffee (br) and Colombia coffee (co), that is brco, contains a unit root, against the alternative that it is a globally stationary ESTAR process.
Given that brco has a nonzero mean, the relevant KSS statistic is that based on OLS demeaned data, which is implemented by default.
Initially, the number of lags is set by the user as p=3:

. kssur brco, maxlag(3)

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

. kssur brco if tin(1992m1,), maxlag(3)

Lastly, we perform the KS test using all the available observations, but with the number of lags determined based on Schwert's formula:

. kssur brco

Stored results

r(varname) Variable name

r(treat) Raw, demeaned or detrended data, depending on the noconstant and trend option

r(minp) First period used in the test regression

r(maxp) Last period used in the test regression

r(tsfmt) Time series format of the time variable

r(N) Number of observations

r(results) Results matrix, 5x6

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 KSS statistic; its p-value; and the critical values at 1%, 5%, and 10%, respectively.

Authors

Jesus Otero, Universidad del Rosario, Colombia
jesus.otero@urosario.edu.co

Jeremy Smith, Warwick University, United Kingdom
jeremy.smith@warwick.ac.uk

References

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.

Kapetanios, G., Y. Shin, and A. Snell (2003). Testing for a unit root in the nonlinear STAR framework. Journal of Econometrics 112, 359-379.

Otero, J., and J. Smith (2017). Response surface models for OLS and GLS detrending-based unit root tests in nonlinear ESTAR models. The Stata Journal, forthcoming.

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