阳光在浪尖跳动 发表于 2015-1-19 17:50
我不知道具体如何操作##~~~加载这个do文件是打开吗?可是打不开……
tsset t
time variable: t, 1 to 100
delta: 1 unit
. reg y ly l2y l3y l4y lx l2x l3x l4x
Source | SS df MS Number of obs = 96
-------------+------------------------------ F( 8, 87) = 0.80
Model | 977.490936 8 122.186367 Prob > F = 0.6006
Residual | 13218.4615 87 151.936339 R-squared = 0.0689
-------------+------------------------------ Adj R-squared = -0.0168
Total | 14195.9525 95 149.431078 Root MSE = 12.326
------------------------------------------------------------------------------
y | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
ly | .1335756 .186695 0.72 0.476 -.237501 .5046522
l2y | .2388074 .1882744 1.27 0.208 -.1354082 .6130231
l3y | .3285186 .1889612 1.74 0.086 -.0470623 .7040995
l4y | .0610861 .1938347 0.32 0.753 -.3241814 .4463535
lx | -.2683143 .4922759 -0.55 0.587 -1.246766 .7101373
l2x | -.4620101 .4860365 -0.95 0.344 -1.42806 .5040401
l3x | -.8758783 .4831491 -1.81 0.073 -1.836189 .0844328
l4x | .0810823 .4901387 0.17 0.869 -.8931214 1.055286
_cons | 1.201616 1.590851 0.76 0.452 -1.960373 4.363606
------------------------------------------------------------------------------
. test lx l2x l3x l4x
( 1) lx = 0
( 2) l2x = 0
( 3) l3x = 0
( 4) l4x = 0
F( 4, 87) = 1.03
Prob > F = 0.3962
. gcause y x,lags(4)
Granger causality test Sample: 5 to 100
obs = 96
H0: x does not Granger-cause y
F( 4, 87) = 1.03
Prob > F = 0.3962
chi2(4) = 4.55 (asymptotic)
Prob > chi2 = 0.3368 (asymptotic)
.
end of do-file
运行结果是这样的,ly l2y l3y l4y lx l2x l3x l4x分别是 一和 x的一阶到四节滞后。小样本汇报F统计量,大样本汇报chi2统计量。计算的统计量虽然有区别,但是结果都是一样的,y和x两组数据都是随机生成的,已知没有任何因果关系,和granger因果检验结果一致。希望你能看明白。