包:{fUnitRoots }
Description
Acollection and description of functions for unit root testing. The family oftests includes ADF tests based on Banerjee's et al. tables and on J.G.McKinnons' numerical distribution functions. Thefunctions are:
adfTest Augmented Dickey–Fuller test for unit roots,
unitrootTest the same based on McKinnons's test statistics.
Usage
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)
Argumentsdescription
a characterstring which allows for a brief description.
lags
themaximum number of lags used for error term correction.
title a character string which allows for aproject title.
type a character string describing the type ofthe unit root regression. Valid choices are "nc" for a regressionwith no intercept (constant) nor time trend, and "c" for a regressionwith an intercept (constant) but no time trend, "ct" for a regressionwith an intercept (constant) and a time trend. The default is "c".
x a numericvector or time series object.
Details
Thefunction adfTest() computes test statistics and p values along theimplementation from Trapletti's augmented Dickey–Fuller test for unit roots. Incontrast to Trapletti's function three kind of test types can
@data a data framewith the input data.
@data.name acharacter string giving the name of the data frame.
@test a list object which holds the output ofthe underlying test function.
@title a characterstring with the name of the test.
@description acharacter string with a brief description of the test. Theentries of the @test slot include the following components:
$statistic the valueof the test statistic.
$parameter the lag order.
$p.value the p-value of the test.
$method acharacter string indicating what type of test was performed.
$data.name a characterstring giving the name of the data.
$alternative acharacter string describing the alternative hypothesis.
$name the name ofthe underlying function, which may be wrapped.
$output additionaltest results to be printed.
Examples
## 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)