% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cips.R
\name{cips_test}
\alias{cips_test}
\alias{cips_test.matrix}
\alias{cips_test.dcce_fit}
\alias{cips_test.default}
\title{Pesaran CIPS Panel Unit Root Test}
\usage{
cips_test(x, ...)

\method{cips_test}{matrix}(x, ..., lags = 0L, trend = FALSE)

\method{cips_test}{dcce_fit}(x, ..., lags = 0L, trend = FALSE)

\method{cips_test}{default}(
  x,
  ...,
  data = NULL,
  unit_index = NULL,
  time_index = NULL,
  lags = 0L,
  trend = FALSE
)
}
\arguments{
\item{x}{A numeric vector, numeric matrix (N x T), data.frame, or
\code{dcce_fit} object. If a vector, \code{data}, \code{unit_index}, and \code{time_index}
must also be supplied.}

\item{...}{Additional arguments passed to methods.}

\item{lags}{Integer: number of lags of \eqn{\Delta y} to include
in the CADF regression. Default 0 (pure CADF without augmentation).}

\item{trend}{Logical: include a linear time trend? Default \code{FALSE}.}

\item{data}{A data.frame containing the panel structure (when \code{x} is
a vector).}

\item{unit_index}{Character: name of the unit variable in \code{data}.}

\item{time_index}{Character: name of the time variable in \code{data}.}
}
\value{
An object of class \code{dcce_cips} with elements:
\describe{
\item{statistic}{The CIPS statistic (truncated cross-sectional average).}
\item{p_value}{Approximate p-value from Pesaran (2007) critical values.}
\item{unit_stats}{Per-unit truncated CADF t-statistics.}
\item{N}{Number of units.}
\item{T}{Time dimension.}
\item{lags}{Number of augmentation lags.}
\item{trend}{Whether a trend was included.}
}
}
\description{
Implements the cross-sectionally augmented IPS (CIPS) panel unit root
test of Pesaran (2007), which allows for cross-sectional dependence
through a single unobserved common factor. For each unit, a
cross-sectionally augmented Dickey-Fuller (CADF) regression is run:
}
\details{
\deqn{\Delta y_{it} = a_i + b_i y_{i,t-1} + c_i \bar{y}_{t-1}
                    + d_i \Delta \bar{y}_t
                    + \sum_{j=1}^{p} \rho_{ij} \Delta y_{i,t-j}
                    + \sum_{j=0}^{p} \delta_{ij} \Delta \bar{y}_{t-j}
                    + u_{it}.}

The CIPS statistic is the cross-sectional average of the unit-level
t-statistics for \eqn{b_i = 0} (the CADF statistic). Critical values
come from Pesaran (2007, Table II(b), constant case) and Pesaran
(2007, Table II(c), constant + trend case). The null hypothesis is
that all series contain a unit root.
}
\examples{
set.seed(1)
N <- 20; T <- 30
f <- cumsum(rnorm(T))
X <- matrix(NA, N, T)
for (i in seq_len(N)) X[i, ] <- cumsum(rnorm(T)) + 0.5 * f
cips_test(X)
}
\references{
Pesaran, M. H. (2007). A simple panel unit root test in the presence
of cross-section dependence. \emph{Journal of Applied Econometrics},
22(2), 265-312.
}
