Learn R Programming

valueprhr (version 0.1.0)

panel_granger_test: Panel Granger Causality Test (Dumitrescu-Hurlin)

Description

Performs panel Granger causality tests between direct and production prices.

Usage

panel_granger_test(panel_data, lags = c(1L, 2L))

Value

A data frame with test results for each direction and lag.

Arguments

panel_data

Data frame in panel format.

lags

Integer vector of lag orders to test. Default c(1, 2).

Details

Tests both directions: direct -> production and production -> direct.

Examples

Run this code
# \donttest{
if (requireNamespace("plm", quietly = TRUE)) {
  set.seed(123)
  panel <- data.frame(
    year = rep(2000:2019, 5),
    sector = rep(LETTERS[1:5], each = 20),
    log_direct = rnorm(100, 5, 0.5),
    log_production = rnorm(100, 5, 0.5)
  )

  granger_results <- panel_granger_test(panel)
  print(granger_results)
}
# }

Run the code above in your browser using DataLab