Title: | A Joint Test-Statistic for the Null of Non-Cointegration |
Version: | 0.2.0 |
Description: | Implements a joint cointegration testing approach that combines Engle-Granger, Johansen maximum eigenvalue, Boswijk, and Banerjee tests into a unified test-statistic for the null of non-cointegration. Also see Bayer and Hanck (2013) <doi:10.1111/j.1467-9892.2012.00814.x>. |
License: | MIT + file LICENSE |
BugReports: | https://github.com/Janine-Langerbein/combcoint/issues |
Depends: | R (≥ 3.6.0) |
Imports: | dplyr, Hmisc, magrittr, purrr, stats, stringr, tibble, tidyr, tsDyn, urca |
Suggests: | MTS, knitr, rmarkdown, testthat (≥ 3.0.0) |
VignetteBuilder: | knitr |
Config/testthat/edition: | 3 |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.3.2 |
URL: | https://github.com/Janine-Langerbein/combcoint |
NeedsCompilation: | no |
Packaged: | 2025-06-11 13:34:14 UTC; LS_Statistik |
Author: | Janine Langerbein [aut, cre, cph],
Jens Klenke |
Maintainer: | Janine Langerbein <janine.langerbein@icloud.com> |
Repository: | CRAN |
Date/Publication: | 2025-06-13 19:40:05 UTC |
Pipe operator
Description
See magrittr::%>%
for details.
Usage
lhs %>% rhs
Arguments
lhs |
A value or the magrittr placeholder. |
rhs |
A function call using the magrittr semantics. |
Value
The result of calling 'rhs(lhs)'.
Cointegration Tests
Description
Executes common cointegration tests, which serve as underlying tests for the Bayer Hanck Test statistic.
Usage
banerjee(formula, data, lags = 1, trend = "const")
boswijk(formula, data, lags = 1, trend = "const")
englegranger(formula, data, lags = 1, trend = "const")
johansen(formula, data, type = "eigen", lags = 1, trend = "const")
Arguments
formula |
An object of class |
data |
An optional data frame containing the variables in the model. |
lags |
Number of lags to be included. |
trend |
Type of deterministic component to be inlcuded, "none" for no deterministics, "const" for a constant and "trend" for a constant plus trend. |
type |
Test to be conducted, either "eigen" or "trace". |
Value
Returns an object of class "list"
.
Functions
-
banerjee()
: Executes Banerjee Test. -
boswijk()
: Executes Boswijk Test. -
johansen()
: Executes Johansen Test.
References
Engle, R. and Granger, C. (1987), Co-integration and Error Correction: Representation, Estimation, and Testing, Econometrica 55(2), 251-76.
Johansen, S. (1988), Statistical analysis of cointegration vectors, Journal of Economic Dynamics and Control 12(2-3), 231-254.
Banerjee, A., Dolado, J. J. and Mestre, R. (1998), Error-correction Mechanism Tests for Cointegration in a Single-equation Framework, Journal of Times Series Analysis 19(3), 267-283.
Boswijk, H. P. (1994), Testing for an unstable root in conditional and structural error correction models, Journal of Econometrics 63(1), 37-60.
Examples
# Luetkepohl (2007): Economic data from West Germany
data(lutkepohl_e1)
englegranger(linvestment ~ lincome + lconsumption, data = lutkepohl_e1)
#' @examplesIf requireNamespace("MTS", quietly = TRUE)
# World Almanac and Book of Facts (1975): Monthly simple returns of the stocks of IBM,
# Coca Cola and S&P Composite index
try({
data("mts-examples", package = "MTS")
englegranger(sp ~ ibm + ko, data = ibmspko)
}, silent = TRUE)
Joint Test-Statistic for the Null of Non-Cointegration
Description
Produces a joint test-statistic for the null of non-cointegration, aggregating various cointegration tests.
Usage
bayerhanck(formula, data, lags = 1, trend = "const", test = "all")
Arguments
formula |
An object of class |
data |
An optional data frame containing the variables in the model. |
lags |
Number of lags to be included. |
trend |
Type of deterministic component to be included. "none" for no deterministic, "const" for a constant and "trend" for a constant plus trend. |
test |
Selection of tests to choose from. Choices are either "ej", for |
Value
bayerhanck
returns an object of classes "bhtest"
and "list"
.
The function summary
is used to print a summary, which includes the test statistics and p-values
for the underlying tests, as well as the test statistic and p-value for the Bayer Hanck Test.
An object of class "bhtest"
is a "list"
containing, inter alia, the components:
bh.test |
the test statistic of the Bayer Hanck Test. |
bh.pval |
the p-Value of the Bayer Hanck Test. |
test.stat |
the test statistics of the underlying tests. |
pval.stat |
the p-values of the underlying tests. |
References
Bayer, C. and Hanck, C. (2013). Combining non-cointegration tests. Journal of Time Series Analysis, 34(1), 83 – 95. doi:10.1111/j.1467-9892.2012.00814.x
Examples
# Luetkepohl (2007): Economic data from West Germany
data(lutkepohl_e1)
bayerhanck(linvestment ~ lincome + lconsumption, data = lutkepohl_e1)
bayerhanck(linvestment ~ lincome + lconsumption, data = lutkepohl_e1, lags = 4)
# World Almanac and Book of Facts (1975): Monthly simple returns of the stocks of IBM,
# Coca Cola and S&P Composite index
try({
data("mts-examples", package = "MTS")
bayerhanck(sp ~ ibm + ko, data = ibmspko)
}, silent = TRUE)
Economic data from West Germany
Description
The data was retrieved from the E1 file of Luetkepohl (2007) and contains quarterly, seasonally adjusted data for fixed investment, disposable income, and consumption expenditures in billions of DM (Deutsche Mark, West German currency before the Euro) from the first quarter of 1960 until the fourth quarter of 1982 for West Germany. The raw data is available at http://www.jmulti.de/download/datasets/e1.dat.
Usage
data(lutkepohl_e1)
Format
A data frame with 92 rows and 10 variables:
- investment
fixed investment.
- income
disposable income.
- consumption
consumption expenditures.
- qtr
time vector in quarterly intervals.
- linvestment
log of fixed investment.
- dlinvestment
first difference of the log of fixed investment.
- lincome
log of disposable income.
- dlincome
first difference of the log of disposable income.
- lconsumption
log of consumption expenditures.
- dlconsumption
first difference of the log of consumption expenditures.
References
Luetkepohl, (2006). New introduction to multiple time series analysis (2nd ed.). Berlin: Springer.