adfTest Augmented Dickey--Fuller test for unit roots,
unitrootTest the same based on McKinnons's test statistics. }unitrootTest(x, lags = 1, type = c("nc", "c", "ct"), title = NULL,
description = NULL)
adfTest(x, lags = 1, type = c("nc", "c", "ct"), title = NULL,
description = NULL)"nc" for a regression
with no intercept (constant) nor time trend, and "c"
for a regression with an intercept (const"fHTEST" with the
following slots:@test slot include the following components:adfTest() computes test statistics and p values
along the implementation from Trapletti's augmented Dickey--Fuller
test for unit roots. In contrast to Trapletti's function three kind
of test types can be selected.
The function unitrootTest() computes test statistics and p values
using McKinnon's response surface approach.## Time Series
# A time series which contains no unit-root:
x = rnorm(1000)
# A time series which contains a unit-root:
y = cumsum(c(0, x))
## adfTest -
adfTest(x)
adfTest(y)
## unitrootTest -
unitrootTest(x)
unitrootTest(y)Run the code above in your browser using DataLab