Phillips–Perron Unit Root Test
pp.test.RdComputes the Phillips-Perron test for the null hypothesis that
x has a unit root.
Arguments
- x
a numeric vector or univariate time series.
- alternative
indicates the alternative hypothesis and must be one of
"stationary"(default) or"explosive". You can specify just the initial letter.- type
indicates which variant of the test is computed and must be one of
"Z(alpha)"(default) or"Z(t_alpha)".- lshort
a logical indicating whether the short or long version of the truncation lag parameter is used.
Details
The general regression equation which incorporates a constant and a
linear trend is used and the Z(alpha) or Z(t_alpha)
statistic for a first order autoregressive coefficient equals one are
computed. To estimate sigma^2 the Newey-West estimator is
used. If lshort is TRUE, then the truncation lag
parameter is set to trunc(4*(n/100)^0.25), otherwise
trunc(12*(n/100)^0.25) is used. The p-values are interpolated
from Table 4.1 and 4.2, p. 103 of
R:Banerjee+Dolado+Galbraith:1993. If the
computed statistic is outside the table of critical values, then a
warning message is generated.
Missing values are not handled.
Value
A list with class "htest" containing the following components:
- statistic
the value of the test statistic.
- parameter
the truncation lag parameter.
- p.value
the p-value of the test.
- method
a character string indicating what type of test was performed.
- data.name
a character string giving the name of the data.
- alternative
a character string describing the alternative hypothesis.
Examples
x <- rnorm(1000) # no unit-root
pp.test(x)
#> Warning: p-value smaller than printed p-value
#>
#> Phillips-Perron Unit Root Test
#>
#> data: x
#> Dickey-Fuller Z(alpha) = -1051, Truncation lag parameter = 7, p-value =
#> 0.01
#> alternative hypothesis: stationary
#>
y <- cumsum(x) # has unit root
pp.test(y)
#>
#> Phillips-Perron Unit Root Test
#>
#> data: y
#> Dickey-Fuller Z(alpha) = -15.105, Truncation lag parameter = 7, p-value
#> = 0.2671
#> alternative hypothesis: stationary
#>