CADFtest {CADFtest} | R Documentation |
This function is an interface to CADFtest.default
that computes the CADF unit root test
proposed in Hansen (1995). The asymptotic p-values of the test are also computed. Automatic
model selection is allowed.
CADFtest(model, X=NULL, trend=c("c", "nc", "ct", "none", "drift", "trend"), data=list(), max.lag.y=1, min.lag.X=0, max.lag.X=0, dname="", Auto=FALSE, criterion=c("BIC", "AIC"), prewhite=FALSE, kernel = c("Parzen", "Quadratic Spectral", "Truncated", "Bartlett", "Tukey-Hanning"))
model |
a formula of the kind y ~ x1 + x2 containing the variable y to be tested and
the stationary covariate(s) to be used in the test. If model=y is specified where y
is a vector or a time series, then an ordinary ADF test is performed. It is not the actual model,
it is used to simplify variable specification. The covariates are assumed to be stationary. |
X |
if model=y , a matrix or a vector time series of stationary covariates X can be passed
directly, instead of using the formula expression. |
trend |
defines the deterministic kernel used in the test. It accepts the values used either in
fUnitRoots or urca packages. It specifies if the underlying model must be with
constant ("c" or "drift", the default), without constant ("nc" or "none"), or with constant and
trend ("ct" or "trend"). |
data |
data to be used (optional). |
max.lag.y |
maximum number of lags allowed for the lagged differences of the variable to be tested. |
min.lag.X |
if negative it is maximum lead allowed for the covariates. If zero, it is the minimum lag allowed for the covariates. |
max.lag.X |
maximum lag allowed for the covariates. |
dname |
character. Data name. In general there is no need to modify the default value. The correct data
name is computed on the basis of the model passed to the function. |
Auto |
logical. If Auto==FALSE then the test is performed using the given orders of lags and leads.
If Auto==TRUE then the test is performed using the model that minimizes the selection
citerion defined in criterion . In this case, the max e min orders serve as upper and
lower bounds in the model selection. |
criterion |
it can be either "BIC" or "AIC" . It is effective only when Auto==T . |
prewhite |
logical or integer. Should the estimating functions be prewhitened? If TRUE or greater than 0
a VAR model of order as.integer(prewhite) is fitted via ar with method "ols"
and demean = FALSE . The default is to use no prewhitening (prewhite = FALSE ). |
kernel |
a character specifying the kernel used. All kernels used are described in Andrews (1991). |
The function returns an object of class c("CADFtest", "htest")
containing:
statistic |
the t test statistic. |
parameter |
the nuisance rho2 parameter. |
method |
the test performed: it can be either ADF or CADF . |
p.value |
the p-value of the test. |
data.name |
the data name. |
max.lag.y |
the maximum lag of the differences of the dependent variable. |
min.lag.X |
the maximum lead of the stationary covariate(s). |
max.lag.X |
the maximum lag of the stationary covariate(s). |
AIC |
the value of the AIC for the selected model. |
BIC |
the value of the BIC for the selected model. |
est.model |
the estimated model. |
estimate |
the estimated value of the parameter of the lagged dependent variable. |
null.value |
the value of the parameter of the lagged dependent variable under the null. |
alternative |
the alternative hypothesis. |
If p-values are used, please cite Costantini, Lupi and Popp (2007).
Claudio Lupi
Hansen, BE (1995): "Rethinking the Univariate Approach to Unit Root Testing: Using Covariates to Increase Power", Econometric Theory, 11 (5), 1148–1171.
Costantini M, Lupi C, Popp S (2007), "A Panel-CADF Test for Unit Roots", University of Molise, Economics & Statistics Discussion Paper 39/07, URL http://econpapers.repec.org/paper/molecsdps/esdp07039.htm.
fUnitRoots
, urca
##---- ADF test on extended Nelson-Plosser data ---- ##-- Data taken from package urca data(npext, package="urca") ADFt <- CADFtest(npext$gnpperca, max.lag.y=3, trend="trend") ##---- CADF test on extended Nelson-Plosser data ---- data(npext, package="urca") npext$unemrate <- exp(npext$unemploy) # compute unemployment rate L <- ts(npext, start=1860) # time series of levels D <- diff(L) # time series of diffs S <- window(ts.intersect(L,D), start=1909) # select same sample as Hansen's CADFt <- CADFtest(L.gnpperca~D.unemrate, data=S, trend="ct", max.lag.y=3)