Augmented Dickey-Fuller unit root test with additive outliers
^dfao^ varname [^if^ exp] [^in^ range] [, ^M^axlag^(^#^)^ ^LLTC^ | ^NOLA^gte > st ^NOAO^test ^NOCON^stant ^NOTR^end ^GEN^erate(newvar) ^REG^ress ^LEV^el(int > eger)]
^dfao^ is for use with time-series data. You must ^tsset^ your data before using ^dfao^; see help @tsset@.
^varname^ may contain time-series operators; see help @varlist@.
^dfao^ performs a Dickey-Fuller (DF 1979, 1981) test for a single unit root in > a time series when one or more additive outliers are present. An additive outlier is a temporary s > hock or aberration in the data, as exemplified by the shock to U.S. grain prices in the mid-1990s. > The approach used here follows the method outlined in Vogelsang (1999) and Franses and Haldrup (1 > 994). The presence of additive outliers induce "in the errors a moving-average component with a ne > gative coefficient" (Vogelsang 1999, p. 237). Schwert (1989) showed that MA errors with a negative > component result in oversized unit root tests. Following Franses and Haldrup (1994), Vogelsang adds > outlier dummy variables to the augmented DF regression. The addition of these dummies does no > t affect the DF dis- tribution if the number of dummies is not too large (see Franses and Haldrup). > Outliers are de- tected using an iterative method [see Vogelsang (pp. 240-2)]. Note that k+2 dum > my variables are added to the DF regression for each outlier found (the contemporaneous dummy an > d k+1 of its lags, where k is the lag length) because an additional lagged dummy is needed "to rem > ove the influence of the outlier on the [kth lagged difference of the dependent variable].... If the > re is more than one outlier and k is moderately large, the degrees of freedom lost ... from outlier > removal can be non- trivial" (Vogelsang 1999, p. 240).
The data are detrended unless the ^notrend^ option is specified, in which case > the data are de- meaned. If ^noconstant^ is specified, then the data are neither detrended nor d > emeaned, though this option cannot be used when testing for additive outliers (see the explanation o > f the ^noconstant^ option below). The maximum lag order for the test is by default calculated from > the sample size using a rule provided by Schwert (1989, p. 151). The maximum lag order may also be pr > ovided with the ^maxlag^ option, and may be zero. If the maximum lag order exceeds one, a sequential lag > -length test is auto- matically performed for each lag using a user-specified criterion (choices are > sequential-t test [see Ng & Perron (1995)], Akaike, Schwarz, or Hannan-Quinn information criteria > [see references]). If the sequential-t test is chosen, then lag-length testing stops when that coeffi > cient's p-value is less than the test size specified by the user (see the explanation of the ^level^ op > tion below). Note that the sample size is held constant over lags at the maximum available sample. Aut > omatic lag selection can be suppressed using the ^nolagtest^ option.
Approximate 1%, 5%, and 10% critical values for the ADF unit root test are calc > ulated using the response surface equations in Cheung and Lai (1995).
^dfao^ prints the variable tested, the time period covered by the DF regression > , the number of observations used in the DF regression, the value of maxlag and how it was sele > cted (by the user or the Schwert criterion), deterministic terms used in the regression (none, co > nstant, or constant + trend), the DF test statistic and the 1%, 5%, and 10% critical values, the MacK > innon (1994) approximate p-value for the test statistic, the optimal lag order, the RMSE (ca > lculated from sample size T), and the outliers together with their respective t-statistics, and crit > ical values. If the ^regress^ option (see below) is selected, the coefficient table for the DF regr > ession is also dis- played. Note that t-statistics from the outlier test are printed as tau# and du > mmy variables are printed as d#, where # is the observation number of the outlier. The outlier t- > statistics and out- lier dummy variables are printed in the order in which outliers were detected, > from most to least significant. The particular information printed depends of course on the option > s chosen.
^dfao^ places in the return array the number of outliers, the t-statistics for > each outlier de- tected in the outlier test, the value of the t-statistic or information criteri > on and RMSE calcu- lated at each lag, the number of observations used in the DF regression, the va > lue of maxlag, the actual number of lags used in the DF regression, the coefficient of the lagged > dependent variable (rho), the DF test statistic (Zt), and the p-value corresponding to Zt. If outl > iers are detected, ^dfao^ also returns a macro listing the dates of the outliers in the order in > which outliers were detected (see the discussion of outlier t-statistics and dummy variables in the > preceding para- graph). The particular data returned depends on the options chosen.
^M^axlag(^#^) specifies the maximum lag order to be used in augmenting the Dick > ey-Fuller regression and only accepts nonnegative integer values. If omitted, the maximum lag order > is calculated as described above. ^LLTC^(^t^|^aic^|^sc^|^hq^) stands for "lag length test criterion." Choices are > "t" (sequential t-test), "aic" (Akaike information criterion), "sc" (Bayesian Schwarz criterion > ), and "hq" (Hannan-Quinn criterion). Only one option may be specified. If omitted, ^LLTC^ > defaults to the sequential t-test.
^NOLA^gtest suppresses automatic lag-length testing. If ^nolagtest^ is specifie > d and ^maxlag^ is omitted, then the DF regression is run with the number of lags determined by th > e Schwert criterion as described above. ^NOLA^gtest generates an error if ^LLTC^ is also specified.
^NOAO^test suppresses the test for additive outliers. If this option is used th > en ^dfao^ works like ^dfuller^, yet and unlike the latter routine, still provides for automatic lag- > length determination and response surface critical values.
^NOCON^stant suppresses the constant in the DF regression. The data are neither > demeaned nor de- trended. Because this option precludes both the inclusion of a trend in the DF > regression and the outlier test, specifying ^NOCON^stant on the command line automatically sets th > e ^NOTR^end and ^NOAO^test options.
^NOTR^end means that the data are demeaned rather than detrended. Since many ti > me series exhibit trending behavior, the default is to include a trend in the auxiliary and DF re > gressions.
^GEN^erate(^newvar^) specifies that the residuals from the DF regression should > be saved as a new variable for subsequent analysis. The residuals correspond to the DF regression > using the lag-length that is specified as an option or computed internally.
^REG^ress displays the coefficient table for the DF regression.
^LEV^el(^#^) controls both the width of the confidence intervals for displayed > statistics and the test size used in both outlier testing and lag-length determination. The test size i > s calculated as 100 - ^level^(^#^). If omitted, ^level^ equals the value contained in the globa > l macro ^$S_Level^.
. ^use http://fmwww.bc.edu/ec-p/data/macro/pervog92^
. ^dfao lfiuscpi^ . ^dfao lfiuscpi, notr lev(90)^ . ^dfao lfiuscpi, notr lev(90) lltc(aic)^
. ^dfao lfiuscpi, notr lev(90) reg^ . ^dfao lfiuscpi, notr lev(90) m(11) nola^ . ^dfao lfiuscpi, noao^ . ^dfao lfiuscpi, nocon^
. ^dfao lfiuscpi, gen(dfaores)^ . ^wntestq dfaores^
Akaike, H. 1973. Information Theory and the Extension of the Maximum Likelihood > Principle. In 2nd International Symposium on Information Theory. eds. B.N. Petrov, and F. > Csaki, 267-81. Budapest: Akailseoniai-Kiudo.
Akaike, H. 1974. A New Look at the Statistical Identification Model. IEEE: Tran > s. Auto Control 19: 716-23
Baum, C. F. 2000. sts15: Test for stationarity of a time series. Stata Technica > l Bulletin 57: 36-39.
Baum, C. F., and R. Sperling. 2000. sts15.1: Tests for stationarity of a time s > eries: update. Stata Technical Bulletin 58: 35-36.
Cheung, Y.-W., and K.S. Lai. 1995. Lag Order and Critical Values of the Augment > ed Dickey-Fuller Test. Journal of Business & Economic Statistics 13: 277-80.
Dickey, D.A., and W.A. Fuller. 1979. Distribution of the Estimators for Autoreg > ressive Time Series with a Unit Root. Journal of the American Statistical Association 74: 427-31.
Dickey, D.A., and W.A. Fuller. 1981. Likelihood Ratio Tests for Autoregressive > Time Series with a Unit Root. Econometrica 49: 1057-72.
Franses, P.H., and N. Haldrup. 1994. The Effects of Additive Outliers on Tests > for Unit Roots and Cointegration. Journal of Business & Economic Statistics 12: 471-78.
Hannan, E.J., and B.G. Quinn. 1979. The Determination of the Order of an Autore > gression. Journal of the Royal Statistical Society, Series B 41: 190-95.
MacKinnon, J.G. 1994. Approximate Asymptotic Distribution Functions for Unit Ro > ot and Cointegration Tests. Journal of Business & Economic Statistics 12: 167-76.
Ng, S., and P. Perron. 1995. Unit Root Tests in ARMA Models with Data-Dependent > Methods for the Selection of the Truncation Lag. Journal of the American Statistical Associatio > n 90: 268-81.
Schwarz, G. 1978. Estimating the Dimension of a Model. Annals of Statistics 6: > 461-64.
Schwert, G.W. 1989. Test for Unit Roots: A Monte Carlo Investigation. Journal o > f Business & Economic Statistics 7: 147-59.
Vogelsang, T.J. 1999. Two Simple Procedures for Testing for a Unit Root When Th > ere are Additive Outliers. Journal of Time Series Analysis 20: 237-52.
Portions of the code were taken from dfuller.ado written by Stata Corp. and ^df > gls^ by Baum and Sperling. Nick Cox provided valuable programming assistance. Thanks also to Tim > Vogelsang for clarifying comments. Finally, Kit Baum made several suggestions that significan > tly improved the functionality of the program in addition to writing portions of this help file. > Remaining errors are mine.
Richard Sperling, The Ohio State University, USA rsperling@@boo.net
Also see --------
Manual: ^[R] dfuller^ On-line: help for @dfuller@, @time@, @tsset@, @dfgls@ (if installed)