楼主: huangruiji110
8670 14

[问答] 单位根检验,同包不同方法下与同方法不同包下的相反结果 [推广有奖]

  • 2关注
  • 11粉丝

已卖:448份资源

讲师

90%

还不是VIP/贵宾

-

威望
0
论坛币
1903 个
通用积分
33.3895
学术水平
9 点
热心指数
19 点
信用等级
7 点
经验
35283 点
帖子
568
精华
0
在线时间
715 小时
注册时间
2010-9-2
最后登录
2015-11-24

楼主
huangruiji110 发表于 2012-4-29 15:47:36 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
对于单位根检验,最常用的方法是ADF检验,另外还有PP检验、KPSS检验,
而R中用于单位根检验的包最常见的是{tseries},另外还有个{urca}包,其报告结果更加详细。

  1. library(tseries)
  2. adf.test(price)                     ## null hypothesis is that x has a unit root
  3. pp.test(price)                     ## null hypothesis is that x has a unit root
  4. kpss.test(price)                  ## Null hypothesis is stationarity

  5. library(urca)
  6. summary(ur.df(price))        ## null hypothesis is that x has a unit root
  7. summary(ur.pp(price))       ## null hypothesis is that x has a unit root
  8. summary(ur.kpss(price))    ## Null hypothesis is stationarity
复制代码

报告结果如下:
————————————————————————————————————————————————
> 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} 非平稳 平稳 平稳

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


二维码

扫码加我 拉你入群

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

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

关键词:单位根检验 包不同 stationarity coefficients significance 单位根检验

已有 1 人评分学术水平 收起 理由
耕耘使者 + 1 鼓励学术交流

总评分: 学术水平 + 1   查看全部评分

@#¥“俺不傻可俺啥都不懂” &*%

沙发
huangruiji110 发表于 2012-4-29 15:58:09
版主@qoiqpwqr 和各位大大可以说一下出现这种情况怎么做吗?
@#¥“俺不傻可俺啥都不懂” &*%

藤椅
huangruiji110 发表于 2012-4-29 19:27:30
没有人碰到过同样的情况么
@#¥“俺不傻可俺啥都不懂” &*%

板凳
shierfeishilixu 发表于 2012-6-18 12:59:14
碰到了类似的,同等解答,顶一下帖子

报纸
耕耘使者 发表于 2012-8-13 13:05:08
也顶一下

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

7
nuomin 发表于 2012-9-1 06:59:16
不同方法出现这种问题不奇怪。因为每个方法的检验效率不同。况且这三个方法使用步骤和条件都不同。处理这些之后,再做这种比较。

8
dixy 发表于 2013-4-27 09:16:21
请问,你这里urca包下的所有方法都是依据检验统计量的值大于临界值即接受原假设,如果小于临界值就拒绝原假设么?

9
一诺9257 发表于 2013-5-5 08:56:38
这些正常,因为对于同一个问题,存在很多检验方法。每个方法的功效不同,自然得到的结果不同。但是统计学中有一个原则(吴喜之老师多次强调):只有有一种检验拒绝,那么就拒绝。

10
jgchen1966 发表于 2013-5-25 18:27:29
本来问题在临界附近,最易出现这类问题,统计上关键瞧你对不确定风险的容忍度,如高,可将值信alpha 取10%,甚至20% 均可,不是非是1%,5%..
鹑居鷇食,鸟行无彰

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-9 03:42