Type: Package
Title: Multiple Granger Causality Tests
Version: 1.0.2
Description: Comprehensive suite of Granger causality tests including standard Toda-Yamamoto (1995) <doi:10.1016/0304-4076(94)01616-8>, Fourier-based tests with single frequency (Enders and Jones, 2016) <doi:10.1515/snde-2014-0101> and cumulative frequencies (Nazlioglu et al., 2019) <doi:10.1080/1540496X.2018.1434072>, as well as quantile causality tests (Cai et al., 2023) <doi:10.1016/j.frl.2023.104327> and Bootstrap Fourier Granger Causality in Quantiles (Cheng et al., 2021) <doi:10.1007/s12076-020-00263-0>. All tests include bootstrap inference for robust p-values.
License: GPL-3
Encoding: UTF-8
LazyData: true
Depends: R (≥ 3.5.0)
Imports: stats, quantreg
Suggests: testthat (≥ 3.0.0)
RoxygenNote: 7.3.3
URL: https://github.com/muhammedalkhalaf/caustests
BugReports: https://github.com/muhammedalkhalaf/caustests/issues
NeedsCompilation: no
Packaged: 2026-03-09 12:46:07 UTC; acad_
Author: Muhammad Alkhalaf ORCID iD [aut, cre, cph], Merwan Roudane [ctb] (Original Stata implementation)
Maintainer: Muhammad Alkhalaf <muhammedalkhalaf@gmail.com>
Repository: CRAN
Date/Publication: 2026-03-12 20:10:03 UTC

caustests: Multiple Granger Causality Tests

Description

Comprehensive suite of Granger causality tests including standard Toda-Yamamoto, Fourier-based tests with single and cumulative frequencies, and quantile causality tests with bootstrap inference.

Main Function

Available Tests

  1. Toda-Yamamoto (1995) - Robust to integration order

  2. Single Fourier Granger (Enders & Jones, 2016)

  3. Single Fourier Toda-Yamamoto (Nazlioglu et al., 2016)

  4. Cumulative Fourier Granger (Enders & Jones, 2019)

  5. Cumulative Fourier Toda-Yamamoto (Nazlioglu et al., 2019)

  6. Quantile Toda-Yamamoto (Cai et al., 2023)

  7. Bootstrap Fourier Granger in Quantiles (Cheng et al., 2021)

Data

Author(s)

Maintainer: Muhammad Alkhalaf muhammedalkhalaf@gmail.com (ORCID) [copyright holder]

Other contributors:

References

Toda, H. Y., & Yamamoto, T. (1995). Statistical inference in vector autoregressions with possibly integrated processes. Journal of Econometrics, 66(1-2), 225-250. doi:10.1016/0304-4076(94)01616-8

Enders, W., & Jones, P. (2016). Grain prices, oil prices, and multiple smooth breaks in a VAR. Studies in Nonlinear Dynamics & Econometrics, 20(4), 399-419. doi:10.1515/snde-2014-0101

Nazlioglu, S., Gormus, N. A., & Soytas, U. (2016). Oil prices and real estate investment trusts (REITs): Gradual-shift causality and volatility transmission analysis. Energy Economics, 60, 168-175. doi:10.1016/j.eneco.2016.09.009

Nazlioglu, S., Soytas, U., & Gormus, N. A. (2019). Oil prices and monetary policy in emerging markets: Structural shifts in causal linkages. Emerging Markets Finance and Trade, 55(1), 105-117. doi:10.1080/1540496X.2018.1434072

Cai, Y., Chang, T., Xiang, Y., & Chang, H. L. (2023). Testing Granger causality in quantiles between the stock and the foreign exchange markets of Japan. Finance Research Letters, 58, 104327. doi:10.1016/j.frl.2023.104327

Cheng, S. C., Hsueh, H. P., Ranjbar, O., Wang, M. C., & Chang, T. (2021). Bootstrap Fourier Granger causality test in quantiles and the asymmetric causal relationship between CO2 emissions and economic growth. Letters in Spatial and Resource Sciences, 14, 31-49. doi:10.1007/s12076-020-00263-0

See Also

Useful links:


Multiple Granger Causality Tests

Description

Performs various Granger causality tests including Toda-Yamamoto, Fourier-based tests (single and cumulative frequency), and quantile causality tests with bootstrap inference.

Usage

caustests(
  data,
  test,
  pmax = 8,
  ic = 1,
  nboot = 1000,
  kmax = 3,
  dmax = NULL,
  quantiles = seq(0.1, 0.9, 0.1),
  verbose = TRUE
)

Arguments

data

A data frame or matrix with time series variables (columns).

test

Integer 1-7 specifying the test type:

  • 1: Toda-Yamamoto (1995)

  • 2: Single Fourier Granger (Enders & Jones, 2016)

  • 3: Single Fourier Toda-Yamamoto (Nazlioglu et al., 2016)

  • 4: Cumulative Fourier Granger (Enders & Jones, 2019)

  • 5: Cumulative Fourier Toda-Yamamoto (Nazlioglu et al., 2019)

  • 6: Quantile Toda-Yamamoto (Cai et al., 2023)

  • 7: Bootstrap Fourier Granger Causality in Quantiles (Cheng et al., 2021)

pmax

Maximum lag order for model selection (default: 8).

ic

Information criterion: 1 for AIC, 2 for SBC/BIC (default: 1).

nboot

Number of bootstrap replications (default: 1000).

kmax

Maximum Fourier frequency (default: 3, used for tests 2-5, 7).

dmax

Extra lags for Toda-Yamamoto augmentation. If NULL, automatically set to 0 for tests 2, 4 (differences) and 1 for tests 1, 3, 5, 6, 7 (levels).

quantiles

Numeric vector of quantiles for tests 6-7 (default: seq(0.1, 0.9, 0.1)).

verbose

Logical; print progress messages (default: TRUE).

Details

The package implements seven Granger causality tests:

Test 1: Toda-Yamamoto (1995) Standard Granger causality in levels using VAR with extra lags equal to the maximum integration order (dmax). This approach is robust to unknown integration and cointegration properties.

Tests 2-3: Single Fourier Frequency Incorporate a single Fourier frequency to capture smooth structural breaks. Test 2 uses first differences, Test 3 uses levels (Toda-Yamamoto style).

Tests 4-5: Cumulative Fourier Frequency Use cumulative Fourier frequencies (1 to k) for more flexible break patterns. Test 4 uses first differences, Test 5 uses levels.

Test 6: Quantile Toda-Yamamoto Extends Toda-Yamamoto to quantile regression, allowing causality analysis across different quantiles of the conditional distribution.

Test 7: Bootstrap Fourier Granger Causality in Quantiles (BFGC-Q) Combines Fourier flexibility with quantile regression for robust inference under structural breaks and across quantiles.

Value

An object of class "caustests" containing:

results

Data frame with test results for each direction

test

Test number used

test_name

Name of the test

pmax

Maximum lag considered

ic

Information criterion used

nboot

Number of bootstrap replications

kmax

Maximum Fourier frequency

dmax

Augmentation lags

quantiles

Quantiles used (for tests 6-7)

quantile_results

Detailed quantile results (for tests 6-7)

References

Toda, H. Y., & Yamamoto, T. (1995). Statistical inference in vector autoregressions with possibly integrated processes. Journal of Econometrics, 66(1-2), 225-250. doi:10.1016/0304-4076(94)01616-8

Enders, W., & Jones, P. (2016). Grain prices, oil prices, and multiple smooth breaks in a VAR. Studies in Nonlinear Dynamics & Econometrics, 20(4), 399-419. doi:10.1515/snde-2014-0101

Nazlioglu, S., Gormus, N. A., & Soytas, U. (2016). Oil prices and real estate investment trusts (REITs): Gradual-shift causality and volatility transmission analysis. Energy Economics, 60, 168-175. doi:10.1016/j.eneco.2016.09.009

Nazlioglu, S., Soytas, U., & Gormus, N. A. (2019). Oil prices and monetary policy in emerging markets: Structural shifts in causal linkages. Emerging Markets Finance and Trade, 55(1), 105-117. doi:10.1080/1540496X.2018.1434072

Cai, Y., Chang, T., Xiang, Y., & Chang, H. L. (2023). Testing Granger causality in quantiles between the stock and the foreign exchange markets of Japan. Finance Research Letters, 58, 104327. doi:10.1016/j.frl.2023.104327

Cheng, S. C., Hsueh, H. P., Ranjbar, O., Wang, M. C., & Chang, T. (2021). Bootstrap Fourier Granger causality test in quantiles and the asymmetric causal relationship between CO2 emissions and economic growth. Letters in Spatial and Resource Sciences, 14, 31-49. doi:10.1007/s12076-020-00263-0

Examples

# Load example data
data(caustests_data)


# Test 1: Toda-Yamamoto test
result1 <- caustests(caustests_data, test = 1, nboot = 199)
print(result1)
summary(result1)

# Test 3: Single Fourier Toda-Yamamoto
result3 <- caustests(caustests_data, test = 3, kmax = 2, nboot = 199)
print(result3)

# Test 6: Quantile causality (fewer quantiles for speed)
result6 <- caustests(caustests_data, test = 6, 
                     quantiles = c(0.25, 0.50, 0.75), nboot = 199)
print(result6)



Example Time Series Dataset for Causality Tests

Description

A simulated dataset containing three time series variables for demonstrating Granger causality tests. The data includes one dependent variable (Y) and two potential causal variables (X1, X2) with known causal relationships.

Usage

caustests_data

Format

A data frame with 200 observations and 3 variables:

Y

Dependent variable, generated as AR(2) plus causal effects from X1

X1

First explanatory variable, AR(1) process

X2

Second explanatory variable, independent AR(1) process

Details

The data generating process is:

This allows users to verify that the causality tests correctly identify the causal direction X1 => Y while finding no significant causality in other directions (with appropriate sample sizes and test settings).

Source

Simulated data for package demonstration

Examples

data(caustests_data)
head(caustests_data)
summary(caustests_data)

# Check correlations
cor(caustests_data)


Plot Quantile Causality Results

Description

Creates diagnostic plots for quantile causality tests (tests 6-7).

Usage

## S3 method for class 'caustests'
plot(x, which = 1, type = "both", ...)

Arguments

x

An object of class "caustests" from test 6 or 7.

which

Which direction to plot (default: 1, first direction).

type

Plot type: "wald" for Wald statistics, "pval" for p-values, or "both" (default).

...

Additional arguments passed to plot.

Value

Invisibly returns the plotted data.

Examples


data(caustests_data)
result <- caustests(caustests_data, test = 6,
                    quantiles = c(0.25, 0.50, 0.75), nboot = 199)
plot(result)