全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
8461 14
2012-04-29
对于单位根检验,最常用的方法是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} 非平稳 平稳 平稳

对于这种同包不同方法下的不同检验结果或者不同包相同方法下的不同检验结果,你是怎么处理的?说说你的看法好吗?还是说我分析过程哪里出错了


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2012-4-29 15:58:09
版主@qoiqpwqr 和各位大大可以说一下出现这种情况怎么做吗?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-4-29 19:27:30
没有人碰到过同样的情况么
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-6-18 12:59:14
碰到了类似的,同等解答,顶一下帖子
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-8-13 13:05:08
也顶一下
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-8-31 00:01:55
建议还是用多种检验方法,取结论一致较多的情况,我以前在做数据的正态性检验的时候也遇到过不同的检验统计量得出相反结论的现象
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群