做多种利率间的VAR检验,要求序列是平稳的。用了9年的利率日数据,然后问题来了,周六周日的数据是缺失的,时间序列存在gap。 如果直接把字符型日期在stata中转换,tset为日期(不连续的),然后dfuller检验平稳性,结果是不平稳的
我又试了另一种方法,直接把日期换成1,2,3,4,5...,tset,就成了连续的时间序列,然后dfuller检验,结果竟然平!稳!了!
求大神指导,这是什么鬼?到底该用原始日期,还是数字编号做时间?已经凌乱了
以下是我的操作..
tset time
Dickey-Fuller test for unit root Number of obs = 768
---------- Interpolated Dickey-Fuller ---------
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
------------------------------------------------------------------------------
Z(t) -5.482 -3.430 -2.860 -2.570
------------------------------------------------------------------------------
MacKinnon approximate p-value for Z(t) = 0.0000
拒绝原假设,是平稳时间序列
gen newdate=daily( date,"YMD")
format newdate %td
tset newdate
dfuller shibor_on
Dickey-Fuller test for unit root Number of obs = 615
---------- Interpolated Dickey-Fuller ---------
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
------------------------------------------------------------------------------
Z(t) 1.259 -3.430 -2.860 -2.570
------------------------------------------------------------------------------
MacKinnon approximate p-value for Z(t) = 0.9964
用了日期以后,再检验同一个指标,就不平稳了。
是不是哪里出了错?求指导!