对于单位根检验,最常用的方法是ADF检验,另外还有PP检验、KPSS检验,
而R中用于单位根检验的包最常见的是{tseries},另外还有个{urca}包,其报告结果更加详细。
报告结果如下:
————————————————————————————————————————————————
> library(tseries)
> adf.test(price) ## null hypothesis is that x has a unit root
Augmented Dickey-Fuller Test
data: price
Dickey-Fuller = -3.5781, Lag order = 6, p-value = 0.03575
alternative hypothesis: stationary
> pp.test(price) ## null hypothesis is that x has a unit root
Phillips-Perron Unit Root Test
data: price
Dickey-Fuller Z(alpha) = -18.6334, Truncation lag parameter = 5,
p-value = 0.09041
alternative hypothesis: stationary
> kpss.test(price) ## Null hypothesis is stationarity
KPSS Test for Level Stationarity
data: price
KPSS Level = 3.9207, Truncation lag parameter = 3, p-value = 0.01
警告信息:
In kpss.test(price) : p-value smaller than printed p-value
>
> library(urca)
> summary(ur.df(price)) ## null hypothesis is that x has a unit root
###############################################
# Augmented Dickey-Fuller Test Unit Root Test #
###############################################
Test regression none
Call:
lm(formula = z.diff ~ z.lag.1 - 1 + z.diff.lag)
Residuals:
Min 1Q Median 3Q Max
-1053.53 -68.74 14.88 93.19 792.42
Coefficients:
Estimate Std. Error t value Pr(>|t|)
z.lag.1 -0.003181 0.006969 -0.456 0.648
z.diff.lag -0.026130 0.063709 -0.410 0.682
Residual standard error: 212.3 on 248 degrees of freedom
Multiple R-squared: 0.001649, Adjusted R-squared: -0.006402
F-statistic: 0.2048 on 2 and 248 DF, p-value: 0.8149
Value of test-statistic is: -0.4564
Critical values for test statistics:
1pct 5pct 10pct
tau1 -2.58 -1.95 -1.62
> summary(ur.pp(price)) ## null hypothesis is that x has a unit root
##################################
# Phillips-Perron Unit Root Test #
##################################
Test regression with intercept
Call:
lm(formula = y ~ y.l1)
Residuals:
Min 1Q Median 3Q Max
-984.02 -87.12 -9.17 76.04 809.96
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 48.76566 24.94151 1.955 0.0517 .
y.l1 0.97519 0.01293 75.433 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 210.3 on 249 degrees of freedom
Multiple R-squared: 0.9581, Adjusted R-squared: 0.9579
F-statistic: 5690 on 1 and 249 DF, p-value: < 2.2e-16
Value of test-statistic, type: Z-alpha is: -8.5727
aux. Z statistics
Z-tau-mu 2.1364
> summary(ur.kpss(price)) ## Null hypothesis is stationarity
#######################
# KPSS Unit Root Test #
#######################
Test is of type: mu with 5 lags.
Value of test-statistic is: 2.6757
Critical value for a significance level of:
10pct 5pct 2.5pct 1pct
critical values 0.347 0.463 0.574 0.739
———————————————————————————————————————————
检验结果报告:
| | ADF检验 | PP检验 | KPSS检验 |
| {tseries} | 平稳 | 非平稳 | 非平稳 |
| {urca} | 非平稳 | 平稳 | 平稳 |
对于这种同包不同方法下的不同检验结果或者不同包相同方法下的不同检验结果,你是怎么处理的?说说你的看法好吗?还是说我分析过程哪里出错了