Skip to contents

A collection and description of functions to compute the distribution and quantile function for MacKinnon's unit root test statistics.

Usage

punitroot(q, N = Inf, trend = c("c", "nc", "ct", "ctt"), 
    statistic = c("t", "n"), na.rm = FALSE)
qunitroot(p, N = Inf, trend = c("c", "nc", "ct", "ctt"), 
    statistic = c("t", "n"), na.rm = FALSE)
    
unitrootTable(trend = c("c", "nc", "ct", "ctt"), statistic = c("t", "n"))

Arguments

q

vector of quantiles or test statistics. Missing values are allowed.

p

a numeric vector of probabilities. Missing values are allowed.

N

the number of observations in the sample from which the quantiles are to be computed.

na.rm

a logical value. If set to TRUE, missing values will be removed, otherwise not. The default is FALSE.

statistic

a character string describing the type of test statistic. Valid choices are "t" for t-statistic, and "n" for normalized statistic, sometimes referred to as the rho-statistic. The default is "t".

trend

a character string describing the regression from which the quantiles are to be computed. Valid choices are: "nc" for a regression with no intercept (constant) nor time trend, "c" for a regression with an intercept (constant) but no time trend, and "ct" for a regression with an intercept (constant) and a time trend. The default is "c".

Details

punitroot computes the cumulative probability of the asymptotic or finite sample distribution of the unit root test statistics.

qunitroot computes the quantiles of the asymptotic or finite sample distribution of the unit root test statistics, given the probabilities.

unitrootTable produces tables of p-values from MacKinnon's response surface.

Value

for punitroot and qunitroot, a numeric vector,

for unitrootTable, a matrix with attribute "control" containing information about the type of test.

Note

The function punitroot and qunitroot use Fortran routines and the response surface approach from J.G. MacKinnon (1988). Many thanks to J.G. MacKinnon putting his code and tables under the GPL license, which made this implementation possible.

Author

J.G. MacKinnon for the underlying Fortran routine and the tables,
Diethelm Wuertz for the Rmetrics R-port.

References

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.

Phillips, P.C.B., Perron, P. (1988); Testing for a unit root in time series regression, Biometrika 75, 335–346.

Examples

## Asymptotic quantile of t-statistic
qunitroot(0.95, trend = "nc", statistic = "t")
#> [1] 1.283601
## 1st argument a vector
qunitroot(c(0.90, 0.95), trend = "nc", statistic = "t")
#> [1] 0.8877673 1.2836012

## Finite sample quantile of n-statistic
qunitroot(0.95, N = 100, trend = "nc", statistic = "n") 
#> [1] 1.301431


## Asymptotic cumulative probability of t-statistic
punitroot(1.2836, trend = "nc", statistic = "t")
#> [1] 0.9499998

## Finite sample cumulative probability of n-statistic
punitroot(1.2836, N = 100, trend = "nc", statistic = "n")
#> [1] 0.9481711

   
## Mac Kinnon's unitrootTable
unitrootTable(trend = "nc")
#>      0.010  0.025  0.050  0.100 0.900 0.950 0.975 0.990
#>  25 -2.661 -2.272 -1.955 -1.609 0.925 1.337 1.701 2.139
#>  50 -2.612 -2.249 -1.948 -1.613 0.906 1.309 1.660 2.073
#> 100 -2.588 -2.238 -1.944 -1.615 0.897 1.296 1.641 2.043
#> 250 -2.574 -2.232 -1.942 -1.616 0.891 1.288 1.630 2.026
#> 500 -2.570 -2.229 -1.941 -1.616 0.890 1.286 1.627 2.021
#> Inf -2.565 -2.227 -1.941 -1.617 0.888 1.284 1.624 2.015
#> attr(,"control")
#>      table      trend  statistic 
#> "unitroot"       "nc"        "t"