update.CADFtest {CADFtest} | R Documentation |
Function to update the formula of CADFtest objects
Description
This function updates the formula and/or the other arguments of CADFtest object and re-run the test
using the updated arguments.
It can be useful if one wants to see the effect of adding/removing stationary covariates or the effect
of changing lags, kernel, etc. If covariates have to be added/removed, update()
works only if
model
is passed as a formula.
Usage
## S3 method for class 'CADFtest'
update(object, change, ...)
Arguments
object |
an object belonging to the class |
change |
list of charater describing the changes to be applied to the existing model. |
... |
currently not used. |
Value
The function re-run the test and returns an object of class CADFtest
. See CADFtest()
.
Author(s)
Claudio Lupi
Examples
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, max.lag.y=3,
kernel="Parzen", prewhite=FALSE)
CADFt.2 <- update(CADFt, change=list("+ D.indprod", "max.lag.X=3",
"criterion='BIC'"))
[Package CADFtest version 0.3-3 Index]