ADF.test: A simple implementation of ADF test

View source: R/ADF.test.R

ADF.testR Documentation

A simple implementation of ADF test

Description

A function for ADF test with the ability to select the number of lags. Lags are selected by informational criterions which can be modified as in Ng and Perron (2001) and Cavaliere et al. (2015).

Usage

ADF.test(
  y,
  const = TRUE,
  trend = FALSE,
  max.lag = 0,
  criterion = NULL,
  modified.criterion = FALSE,
  rescale.criterion = FALSE
)

Arguments

y

A time series of interest.

const, trend

Whether a constand and trend are to be included.

max.lag

Maximum lag number.

criterion

A criterion used to select number of lags. If lag selection is not needed keep this NULL.

modified.criterion

Whether the unit-root test modificaton is needed.

rescale.criterion

Whether the rescaling informational criterion is needed. Designed to cope with heteroscedasticity in residuals.

Details

Due to the Frisch-Waugh-Lovell theorem we first detrend y and then apply the test to the detrended series.

Value

A list containing:

  • y,

  • const,

  • trend,

  • residuals,

  • coefficient estimates,

  • t-statistic value,

  • critical value,

  • Number of lags,

  • indicator of stationarity.

References

Cavaliere, Giuseppe, Peter C. B. Phillips, Stephan Smeekes, and A. M. Robert Taylor. “Lag Length Selection for Unit Root Tests in the Presence of Nonstationary Volatility.” Econometric Reviews 34, no. 4 (April 21, 2015): 512–36. https://doi.org/10.1080/07474938.2013.808065.

Ng, Serena, and Pierre Perron. “Lag Length Selection and the Construction of Unit Root Tests with Good Size and Power.” Econometrica 69, no. 6 (2001): 1519–54. https://doi.org/10.1111/1468-0262.00256.


d9d6ka/RANEPA-R documentation built on May 4, 2024, 7:11 a.m.