% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cointegration_extra.R
\name{panel_coint_test}
\alias{panel_coint_test}
\title{Pedroni and Kao Panel Cointegration Tests}
\usage{
panel_coint_test(
  data,
  unit_index,
  time_index,
  formula,
  test = c("pedroni", "kao"),
  lags = 1L
)
}
\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 in levels: \code{y ~ x1 + x2}.}

\item{test}{Character: \code{"pedroni"} or \code{"kao"}.}

\item{lags}{Integer: ADF lag order for the residual regression.
Default 1.}
}
\value{
An object of class \code{dcce_cointegration_extra} with
elements \code{test}, \code{statistics} (a tibble), \code{N},
\code{T_bar}, \code{lags}.
}
\description{
Implements simplified versions of the Pedroni (1999, 2004) and
Kao (1999) residual-based panel cointegration tests.
}
\details{
\strong{Pedroni:} Fits unit-level OLS regressions of \eqn{y} on
\eqn{x_1, \ldots, x_K}, extracts the residuals, runs an ADF
regression on each unit's residual series, and averages the
t-statistics. Reports the group-mean t-statistic (\code{group_t})
and the group-mean rho-statistic (\code{group_rho}).

\strong{Kao:} Similar but pools the residuals rather than averaging
unit-level statistics. Reports a single ADF t-statistic on the
demeaned pooled residuals.

Both tests have null hypothesis \strong{no cointegration}. A large
negative statistic rejects the null.
}
\examples{
data(pwt8)
panel_coint_test(
  data = pwt8, unit_index = "country", time_index = "year",
  formula = log_rgdpo ~ log_hc + log_ck,
  test = "pedroni", lags = 1
)
}
\references{
Pedroni, P. (1999). Critical values for cointegration tests in
heterogeneous panels with multiple regressors. \emph{Oxford Bulletin of
Economics and Statistics}, 61(S1), 653--670.

Pedroni, P. (2004). Panel cointegration: asymptotic and finite
sample properties of pooled time series tests with an application
to the PPP hypothesis. \emph{Econometric Theory}, 20(3), 597--625.

Kao, C. (1999). Spurious regression and residual-based tests for
cointegration in panel data. \emph{Journal of Econometrics}, 90(1),
1--44.
}
