% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/workflow.R
\name{dcce_workflow}
\alias{dcce_workflow}
\title{Automatic Diagnostic Workflow for Panel Data with CSD}
\usage{
dcce_workflow(
  data,
  unit_index,
  time_index,
  formula,
  max_cr_lags = NULL,
  significance = 0.05,
  verbose = TRUE,
  n_bootstrap = 0L
)
}
\arguments{
\item{data}{A panel data.frame.}

\item{unit_index}{Character: unit identifier column.}

\item{time_index}{Character: time identifier column.}

\item{formula}{Two-sided formula (levels, not differences).}

\item{max_cr_lags}{Integer: maximum CSA lag order to evaluate.
Default \code{NULL} uses \eqn{\lfloor T^{1/3} \rfloor}.}

\item{significance}{Numeric: significance level used for decisions.
Default \code{0.05}.}

\item{verbose}{Logical: print progress as each step runs. Default
\code{TRUE}.}

\item{n_bootstrap}{Integer: bootstrap replications for the Westerlund
p-values. Default \code{0L} (asymptotic).}
}
\value{
An object of class \code{dcce_workflow} with elements
\code{panel_summary}, \code{unit_root}, \code{csd_premodel},
\code{cointegration}, \code{rank_condition}, \code{optimal_cr_lags},
\code{recommendation}, and \code{call}.
}
\description{
Runs the recommended pre-estimation diagnostic sequence on a panel
regression specification and returns a structured report with a
suggested \code{dcce()} call. The workflow performs six steps:
}
\details{
\enumerate{
\item Panel summary (N, T, balance).
\item Pesaran (2007) CIPS panel unit root test on each variable.
\item Pesaran CD test on raw residuals (pooled OLS) to check for
cross-sectional dependence.
\item Westerlund (2007) cointegration test, if at least one variable
is non-stationary.
\item Rank condition classifier (De Vos et al. 2024) for a baseline
static CCE fit.
\item Information criterion selection of the optimal CSA lag order.
}

Based on the results, the function chooses a recommended estimator
from \code{c("mg", "cce", "dcce", "pmg", "csardl")} and returns a
printable suggested \code{dcce()} call.
}
\examples{
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)
}
