This package performs Kapetanios' (2005) unit root test. The test controls for up to 5 level and/or trend breaks under the alternative hypothesis of trend stationarity. The main advantage of this procedure is that break dates are endogenously defined. _______________________________________________________________________________ Original article: Kapetanios, G. (2005). Unit-root testing against the alternative hypothesis of up to m structural breaks. Journal of Time Series Analysis, 26(1), 123-133. _______________________________________________________________________________ The test proposed by Kapetanios is an extension of Zivot and Andrews' (1992) unit root test: the former allows for up to five structural breaks (level, trend or both) whilst the latter for only 1 break. There are however two main limitations: 1.- The number of breaks must be defined by the user. 2.- Breaks are not considered under the null hypothesis of unit root. The function must be feed with the following inputs: 1.- The time series to be tested. 2.- The number of breaks (min 1, max 5) 3.- The maximum number of lags (the code then chooses the optimal number using Perron's backward significant t-ratio). 4.- The trimming parameter, this is, the number of obs. (as % of the sample size) that must be forced between breaks and between break and endpoints of the sample size. 5.- Model specification: (1) only level breaks. (2) only trend breaks. (3) level and trend breaks. The output is: 1.- The test statistic. 2.- The statistical decision, according to 1%, 5% or 10% critical values. 3.- The break dates. It is important to acknowledge that this code prevents the user to set 'too many' breaks: when the sample trimming/number of breaks combination is such that there is not 'enough space' to fit the breaks, the code reduces the No of breaks. Also, the code is designed to stop when the trimming parameter is 'too small', this is, when there are numerical problems to invert the (X'X) matrix because of almost perfect collinearity of two (or more) regressors. _______________________________________________________________________________ backlog: 2.1, April 2022: (i) Minor bug with non-trivial effects: The printing of the test statistic (not its computation) was incorrect. FIXED; (ii) now the output includes the printing of the auxiliary regression.