xtpcaus: Panel Granger Causality Tests

View source: R/xtpcaus.R

xtpcausR Documentation

Panel Granger Causality Tests

Description

Tests whether x Granger-causes y in a balanced panel using either the Panel Fourier Toda-Yamamoto (PFTY) test or the Panel Quantile Causality (PQC) test.

Usage

xtpcaus(
  data,
  y,
  x,
  panel_id,
  time_id,
  test = c("pfty", "pqc"),
  pmax = 4L,
  dmax = 1L,
  nboot = 499L,
  kmax = 3L,
  ic = c("aic", "bic"),
  quantiles = c(0.1, 0.25, 0.5, 0.75, 0.9),
  seed = -1L
)

Arguments

data

A data frame in long format.

y

Character. Name of the dependent (caused) variable.

x

Character. Name of the independent (causing) variable.

panel_id

Character. Name of the panel identifier variable.

time_id

Character. Name of the time variable.

test

Character. Test type: "pfty" for Panel Fourier Toda-Yamamoto or "pqc" for Panel Quantile Causality.

pmax

Integer. Maximum lag order for selection. Default is 4.

dmax

Integer. Maximum integration order for Toda-Yamamoto augmentation. Default is 1.

nboot

Integer. Number of bootstrap replications. Minimum 99. Default is 499.

kmax

Integer. Maximum Fourier frequency (PFTY only). Default is 3.

ic

Character. Information criterion: "aic" or "bic". Default is "aic".

quantiles

Numeric vector. Quantile grid for PQC test (values strictly between 0 and 1). Default is c(0.1, 0.25, 0.50, 0.75, 0.90).

seed

Integer. Random seed for bootstrap. -1 means no seed. Default is -1.

Value

An object of class "xtpcaus" containing:

test

Character. "pfty" or "pqc".

N

Integer. Number of panel units.

TT

Integer. Number of time periods.

nboot

Integer. Number of bootstrap replications.

y

Character. Name of the y variable.

x

Character. Name of the x variable.

For PFTY:

fisher

Numeric. Fisher panel statistic.

fisher_df

Integer. Degrees of freedom (2*N).

fisher_pv

Numeric. Fisher p-value.

wbar

Numeric. Average individual Wald statistic.

zbar

Numeric. Dumitrescu-Hurlin Z-bar statistic.

zbar_pv

Numeric. Z-bar p-value.

ind_wald

Numeric vector. Individual Wald statistics (length N).

ind_freq

Integer vector. Optimal Fourier frequencies (length N).

ind_pval_b

Numeric vector. Bootstrap p-values (length N).

ind_lags

Integer vector. Selected lag orders (length N).

For PQC:

quantiles

Numeric vector. Quantiles tested.

wald_xy

Numeric vector. Wald statistics per quantile (x => y).

pval_xy

Numeric vector. Bootstrap p-values per quantile (x => y).

wald_yx

Numeric vector. Wald statistics per quantile (y => x).

pval_yx

Numeric vector. Bootstrap p-values per quantile (y => x).

supwald_xy

Numeric. Sup-Wald statistic for x => y.

supwald_yx

Numeric. Sup-Wald statistic for y => x.

p_opt

Integer. Selected optimal lag.

References

Chuang, C.C., Kuan, C.M. and Lin, H.Y. (2009). Causality in quantiles and dynamic stock return-volume relations. Journal of Banking and Finance, 33(7), 1351–1360. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.jbankfin.2009.02.013")}

Emirmahmutoglu, F. and Kose, N. (2011). Testing for Granger causality in heterogeneous mixed panels. Economic Modelling, 28(3), 870–876. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.econmod.2010.10.018")}

Toda, H.Y. and Yamamoto, T. (1995). Statistical inference in vector autoregressions with possibly integrated processes. Journal of Econometrics, 66(1–2), 225–250. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/0304-4076(94)01616-8")}

Wang, K.M. and Nguyen, T.B. (2022). A quantile panel-type analysis of income inequality and healthcare expenditure. Economic Research, 35(1), 873–893. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/1331677X.2021.1952089")}

Yilanci, V. and Gorus, M.S. (2020). Does economic globalization have predictive power for ecological footprint. Environmental Science and Pollution Research, 27, 40552–40562. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s11356-020-10092-9")}

Examples

dat <- grunfeld_panel()
# PFTY test (quick with few bootstrap reps)

res <- xtpcaus(dat, y = "invest", x = "mvalue",
               panel_id = "firm", time_id = "year",
               test = "pfty", pmax = 2L, dmax = 1L,
               nboot = 99L, kmax = 2L, seed = 42L)
print(res)


# PQC test

res2 <- xtpcaus(dat, y = "invest", x = "mvalue",
                panel_id = "firm", time_id = "year",
                test = "pqc", pmax = 2L, nboot = 99L,
                quantiles = c(0.25, 0.50, 0.75), seed = 42L)
print(res2)



caustests documentation built on April 5, 2026, 9:06 a.m.