现在研究两种软件的单位根检验,一种是eviews,一种是R 的urca包。
使用数据:北京市居民收入与消费数据,从1978年到2008年
359.86,
01.434184675835
454.498276309448
467.86775074859
480.614393457504
513.310748322097
583.35805638461
686.937297091586
743.554253546036
736.129658598965
775.468958132907
691.146948448848
709.924378107387
716.954534882237
748.694400158079
866.328426656718
975.453479941415
1009.75891131917
1032.732682006
1118.08508305723
1165.26806638124
1245.99589092273
1363.60693932882
1389.44583850677
1630.87349692008
1760.43454365832
1911.69165381973
2044.57696073946
2268.26232165585
2290.55766229978
2340.02546850029
使用eviews软件时,选择参数如下:
eviews结果如下:
Null Hypothesis: Y has a unit root
Exogenous: Constant
Lag Length: 3 (Fixed)
t-Statistic Prob.*
Augmented Dickey-Fuller test statistic 0.842051 0.9929
Test critical values: 1% level -3.699871
5% level -2.976263
10% level -2.627420
*MacKinnon (1996) one-sided p-values.
Augmented Dickey-Fuller Test Equation
Dependent Variable: D(Y)
Method: Least Squares
Date: 02/04/15 Time: 16:06
Sample (adjusted): 1982 2008
Included observations: 27 after adjustments
Variable Coefficient Std. Error t-Statistic Prob.
Y(-1) 0.041160 0.048881 0.842051 0.4088
D(Y(-1)) 0.110331 0.244465 0.451316 0.6562
D(Y(-2)) 0.124078 0.282272 0.439569 0.6645
D(Y(-3)) -0.091452 0.282309 -0.323942 0.7490
C 13.34127 32.65793 0.408515 0.6868
R-squared 0.197945 Mean dependent var 69.33917
Adjusted R-squared 0.052117 S.D. dependent var 69.87615
S.E. of regression 68.03094 Akaike info criterion 11.44338
Sum squared resid 101820.6 Schwarz criterion 11.68335
Log likelihood -149.4856 Hannan-Quinn criter. 11.51473
F-statistic 1.357383 Durbin-Watson stat 1.971312
Prob(F-statistic) 0.280749
==================以下为R语言========================
运行命令如下:
> library(urca)
> lc.df <- ur.df(y=xts, lags=3, type='drift')
> summary(lc.df)
结果如下:
###############################################
# Augmented Dickey-Fuller Test Unit Root Test #
###############################################
Test regression drift
Call:
lm(formula = z.diff ~ z.lag.1 + 1 + z.diff.lag)
Residuals:
Min 1Q Median 3Q Max
-127.823 -31.303 -1.035 32.152 160.835
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 13.34127 32.65793 0.409 0.687
z.lag.1 0.04116 0.04888 0.842 0.409
z.diff.lag1 0.11033 0.24447 0.451 0.656
z.diff.lag2 0.12408 0.28227 0.440 0.665
z.diff.lag3 -0.09145 0.28231 -0.324 0.749
Residual standard error: 68.03 on 22 degrees of freedom
Multiple R-squared: 0.1979, Adjusted R-squared: 0.05212
F-statistic: 1.357 on 4 and 22 DF, p-value: 0.2807
Value of test-statistic is: 0.8421 1.61
Critical values for test statistics:
1pct 5pct 10pct
tau2 -3.58 -2.93 -2.60
phi1 7.06 4.86 3.94
从上述结果可一知道,在回归的结果上,R语言能够与eviews保持高度一直,但是在Test critical values,1%,5%,10%点的值却不完全一样,比如:
R的结果为:
1pct 5pct 10pct
tau2 -3.58 -2.93 -2.60
eviews对应的结果为:
-3.699871 -2.976263 -2.627420
这里有可能是urca在程序包内设定计算1%,5%,10%点的值,与eviews计算这三点的值的分布函数不一样,一个是T分布,一个是正态分布。
【还有个问题:R语言计算出来的phi1 7.06 4.86 3.94,代表什么变量,请高手解答一下】
可以看出还是有一定的区别,但是这里并不影响对单位根的判别, 两种软件的T统计量一致,相伴概率均接近1,拒绝原假设,说明序列是非平稳的,存在单位根。