ur.df2 | R Documentation |
Augmented-Dickey-Fuller Unit Root Test revised
ur.df2(y, type = c("none", "drift", "trend"), lags = 1,
selectlags = c("Fixed", "AIC", "BIC"), digit = 2)
y |
Vector to be tested for a unit root. |
type |
Test type, either "none", "drift" or "trend". |
lags |
Number of lags for endogenous variable to be included. |
selectlags |
Lag selection can be achieved according to the Akaike "AIC" or the Bayes "BIC" information criteria. The maximum number of lags considered is set by lags. The default is to use a "fixed" lag length set by lags. |
digit |
The digit choice. |
This is a modification of ur.df
in the library of urca
. The function was written in S4, and it is changed into S3. The lag selected by AIC or BIC is reported explicitly through lag.used
in the output list. In addition, the values of AIC and BIC statistics are reported.
Return an object of class ur.df2
: the new outputs are lag.used
, aic
, and bic
.
y |
input of y |
model |
input of model |
cval |
critical values |
lags |
input of lags |
lag.used |
acutal lags used |
teststat |
test statistics |
res |
resiuals of the test regression |
aic |
aic values |
bic |
bic values |
test.name |
test name |
Two methods are defined as follows:
print
:print test statistics and critical values.
plot
:plot outputs.
Changyou Sun (edwinsun258@gmail.com)
ur.df
in urca
library.
# see the code for the study: Japan and China wood product imports
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.