Learn R Programming

fUnitRoots (version 2160.77)

UnitrootTests: Unit Root Time Series Tests

Description

A collection and description of functions for unit root testing. The family of tests includes ADF tests based on Banerjee's et al. tables and on J.G. McKinnons' numerical distribution functions. The functions are: ll{ adfTest Augmented Dickey--Fuller test for unit roots, unitrootTest the same based on McKinnons's test statistics. }

Usage

unitrootTest(x, lags = 1, type = c("nc", "c", "ct"), title = NULL, 
    description = NULL)
    
adfTest(x, lags = 1, type = c("nc", "c", "ct"), title = NULL, 
    description = NULL)

Arguments

description
a character string which allows for a brief description.
lags
the maximum number of lags used for error term correction.
title
a character string which allows for a project title.
type
a character string describing the type of the unit root regression. Valid choices are "nc" for a regression with no intercept (constant) nor time trend, and "c" for a regression with an intercept (const
x
a numeric vector or time series object.

Value

  • The tests return an object of class "fHTEST" with the following slots:
  • @callthe function call.
  • @dataa data frame with the input data.
  • @data.namea character string giving the name of the data frame.
  • @testa list object which holds the output of the underlying test function.
  • @titlea character string with the name of the test.
  • @descriptiona character string with a brief description of the test.
  • The entries of the @test slot include the following components:
  • $statisticthe value of the test statistic.
  • $parameterthe lag order.
  • $p.valuethe p-value of the test.
  • $methoda character string indicating what type of test was performed.
  • $data.namea character string giving the name of the data.
  • $alternativea character string describing the alternative hypothesis.
  • $namethe name of the underlying function, which may be wrapped.
  • $outputadditional test results to be printed.

Details

The function adfTest() computes test statistics and p values along the implementation from Trapletti's augmented Dickey--Fuller test for unit roots. In contrast to Trapletti's function three kind of test types can be selected. The function unitrootTest() computes test statistics and p values using McKinnon's response surface approach.

References

Banerjee A., Dolado J.J., Galbraith J.W., Hendry D.F. (1993); Cointegration, Error Correction, and the Econometric Analysis of Non-Stationary Data, Oxford University Press, Oxford. Dickey, D.A., Fuller, W.A. (1979); Distribution of the estimators for autoregressive time series with a unit root, Journal of the American Statistical Association 74, 427--431. MacKinnon, J.G. (1996); Numerical distribution functions for unit root and cointegration tests, Journal of Applied Econometrics 11, 601--618. Said S.E., Dickey D.A. (1984); Testing for Unit Roots in Autoregressive-Moving Average Models of Unknown Order, Biometrika 71, 599--607.

Examples

Run this code
## Time Series 
   # A time series which contains no unit-root:
   x = rnorm(1000)  
   # A time series which contains a unit-root:
   y = cumsum(c(0, x))
   
## adfTest - 
   adfTest(x)
   adfTest(y)
   
## unitrootTest - 
   unitrootTest(x)
   unitrootTest(y)

Run the code above in your browser using DataLab