Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: times
See also: kpss

Quantlet: adf
Description: calculates the test statistic 'tau' for a unit root in a time series according to the Augmented Dickey-Fuller test. Nonstandard critical values are given according to MacKinnon's response surface. t-values and corresponding probability-values are given for the coefficients of the lagged differences. Moreover, the residuals of the regression are calculated.

Reference(s):

Usage: {tau,diagnostics} = adf(y,p{,constant,trend})
Input:
y T x 1 vector, times series
p scalar, number of lagged differences that will be included in the regression
constant optional string, a constant is included in the regression if constant = "constant"
trend optional string, a linear trend is included in the regression if trend = "trend"
Output:
tau scalar, value of the test statistic for a unit root
diagnostics list that contains three regression diagnostics. Vector "critvalues" contains 1%, 5%, and 10% critical values for the test statistic tau. The matrix "tvalueslags" contains t-values for the estimated coefficients of the lagged differences (first column) and the corresponding probability-values. If no lags are included (that is, p = 0), "tvalueslags" consists of zeros. The "residuals" of the regression can be used for further analysis and should appear to be white noise.

Note:

Example:
library("times")              ; loads the quantlets from times library
lndax = log(read("dax.dat"))  ; log of monthly DAX 1979:1-2000:10
{tau,cv} = adf(lndax,4,"constant","trend")
; constant and trend are included because the alternative is an ARMA process with trend
tau                           ; test statistic for a unit root
cv.critvalues                 ; nonstandard critical values for tau
cv.tvalueslags                ; t- and probability-values for the estimated coefficients of lagged differences
qlb = boxlj(cv.residuals,5)
; calculates the acf and the Box-Lung statistics with probability-values for the first five lags of the residuals
qlb                           ; renders the calculations of boxlj

Result:
Contents of tau

[1,]  -2.3643

Contents of critvalues

[1,]  -3.997
[2,]  -3.4286
[3,]  -3.1374

Contents of tvalueslags

[1,]  0.83643  0.4029
[2,]  0.78346  0.43334
[3,] -0.25112  0.80172
[4,]  0.53469  0.59285

Contents of qlb

[1,]  0.00074361  0.00014377  0.99043
[2,]  0.0030101   0.0025089   0.99875
[3,]  0.0020374   0.0035967   0.99994
[4,]  0.0039383   0.0076774   0.99999
[5,] -0.047818    0.61164     0.98746

Even at the 10% level the critical value is -3.1374 and we can not reject the null
hypothesis that the log DAX series has a unit root. The number of included lagged
differences may be smaller to remove any serial correlation in the residuals. Four
lags are chosen to show the output for a regression with lagged differences.



Author: P. Moral, R. Schulz, 20020723 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006