Learn R Programming

dcce (version 0.4.2)

dcce_workflow: Automatic Diagnostic Workflow for Panel Data with CSD

Description

Runs the recommended pre-estimation diagnostic sequence on a panel regression specification and returns a structured report with a suggested dcce() call. The workflow performs six steps:

Usage

dcce_workflow(
  data,
  unit_index,
  time_index,
  formula,
  max_cr_lags = NULL,
  significance = 0.05,
  verbose = TRUE,
  n_bootstrap = 0L
)

Value

An object of class dcce_workflow with elements panel_summary, unit_root, csd_premodel, cointegration, rank_condition, optimal_cr_lags, recommendation, and call.

Arguments

data

A panel data.frame.

unit_index

Character: unit identifier column.

time_index

Character: time identifier column.

formula

Two-sided formula (levels, not differences).

max_cr_lags

Integer: maximum CSA lag order to evaluate. Default NULL uses \(\lfloor T^{1/3} \rfloor\).

significance

Numeric: significance level used for decisions. Default 0.05.

verbose

Logical: print progress as each step runs. Default TRUE.

n_bootstrap

Integer: bootstrap replications for the Westerlund p-values. Default 0L (asymptotic).

Details

  1. Panel summary (N, T, balance).

  2. Pesaran (2007) CIPS panel unit root test on each variable.

  3. Pesaran CD test on raw residuals (pooled OLS) to check for cross-sectional dependence.

  4. Westerlund (2007) cointegration test, if at least one variable is non-stationary.

  5. Rank condition classifier (De Vos et al. 2024) for a baseline static CCE fit.

  6. Information criterion selection of the optimal CSA lag order.

Based on the results, the function chooses a recommended estimator from c("mg", "cce", "dcce", "pmg", "csardl") and returns a printable suggested dcce() call.

Examples

Run this code
data(pwt8)
wf <- dcce_workflow(
  data       = pwt8,
  unit_index = "country",
  time_index = "year",
  formula    = log_rgdpo ~ log_hc + log_ck + log_ngd,
  verbose    = FALSE
)
print(wf)

Run the code above in your browser using DataLab