Learn R Programming

erer (version 4.0)

ur.df2: Augmented-Dickey-Fuller Unit Root Test revised

Description

Augmented-Dickey-Fuller Unit Root Test revised

Usage

ur.df2(y, type = c("none", "drift", "trend"), lags = 1, 
  selectlags = c("Fixed", "AIC", "BIC"), digit = 2)

Value

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

Arguments

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.

Methods

Two methods are defined as follows:

print:

print test statistics and critical values.

plot:

plot outputs.

Author

Changyou Sun (edwinsun258@gmail.com)

Details

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.

See Also

ur.df in urca library.

Examples

Run this code
# see the code for the study: Japan and China wood product imports

Run the code above in your browser using DataLab