楼主: grmorpheus
14612 12

[面板数据求助] 如何用STATA做panel data的格兰杰因果检验 [推广有奖]

  • 0关注
  • 0粉丝

已卖:15份资源

高中生

77%

还不是VIP/贵宾

-

威望
0
论坛币
81 个
通用积分
0
学术水平
1 点
热心指数
-4 点
信用等级
1 点
经验
276 点
帖子
24
精华
0
在线时间
34 小时
注册时间
2006-4-10
最后登录
2014-6-18

楼主
grmorpheus 发表于 2010-11-16 09:04:55 |AI写论文
30论坛币
各位大侠:
       我现在想要做panel data的格兰杰因果检验,该怎么做啊? 求高人指点。 最好能告诉命令是什么,中间的步骤。
       比如 n家公司10年对应的 y  x  这样的panel data 如何做。
       我在 tsset  公司名称  年份代码
       后 用 gcause 等命名 都说这样的命令不能用在panel data上,急,求高人指点。

关键词:panel data 格兰杰因果检验 格兰杰因果 Panel Stata 检验 检验 Stata Stata Data Data 格兰杰 格兰杰 Panel Panel

沙发
rosenbloog 发表于 2010-11-16 10:25:16

这个帖子跟下面重复,请删除

[biggrin] [biggrin]

藤椅
rosenbloog 发表于 2010-11-16 10:32:10
Stata好像还没有出具体的包裹针对panle data做格兰杰检验,这个检验本来是针对time series。
但是理论倒是出了,请参见: Christophe Hurlin and Baptiste Venet:Granger Causality Tests in Panel Data Models with Fixed Coefficients
沿着这个思路,可以再Matlab或者其他编程软件里,自己或找人实现。

另外,Stata论坛里Kit Baum给了一些不完整的答复:
Q: granger x y,lag(2) However, I receive an error message saying "repeated time values in sample". Therefore, I had to collapse the data to achieve 1 observation for each year. Is there any way that I can utilize my whole data to do causality test?
Sarah
A: Please see my recent posts on the use of DW statistic in panel. This is the same problem. The granger[-sims] test is a time series regression. One can run it separately for each unit of the panel, but how should you combine the results? Average the test statistics over unit, like some panel unit root tests? To test for causality using an entire panel, you must have a statistic that is designed for panel data.
Kit

所以,你对每个unit做格兰杰检验: webuse grunfeld gcause2 invest mvalue if company==4, lag(4) 对其他的company再做一遍,average。

不完整,希望有高手补充~

板凳
grmorpheus 发表于 2010-11-16 11:01:42
我也看到这个人给的回复,单独公司做倒是没有问题,但是能否直接将结果平均在呢?如果能, 如何平均?平均那个P值? 这样做是否有道理,我就不知道了。

报纸
grmorpheus 发表于 2010-11-16 11:09:35
2# rosenbloog
哎呀 忘记了

地板
lujunyi1982 发表于 2010-11-23 10:08:36
Granger causality test
        gcause var1 var2 [if exp] [in range] , lags(#) [ exog(varlist) regress
                           ]

gcause is for use with time-series data.  You must tsset your data before
using this commands; see help tsset.

Description
gcause performs a Granger causality test to investigate whether lagged values
of a variable, var2, help in forecasting another variable, var1.  See Methods
& Formulas below.

Options
lags(#) is not optional.  It specifies the number of lags of var1 and var2 to
    include in the regression.
exog(varlist) for lack of a better name, specifies other conditioning
    variables which may enter the regression.  varlist may contain time-series
    operators which is particularly useful to add other lagged variables to
    the test regressions.
regress requests the display of the output from the unrestricted regression.

Methods & Formulas
Granger-causality tests are usually performed in the context of vector
autoregressions (VAR) or more specifically, individual equations within VAR
systems.  Individual equations in VARs are known as autoregressive distributed
lag (ADL) relationships and may be represented as
                 p                p
    y_t = c_1 + SUM a_i *y_t-i + SUM b_i *x_t-i + D_t + u_t
                i=1              i=1
    (t = 1,...,T )
where y_t and x_t respectively refer to var1 and var2 in gcause's syntax
diagram and D_t corresponds to other variables that need to be controlled for,
if any, specified at exog().  p is determined by lags().
The null hypothesis that x_t does not Granger-cause y_t amounts to testing
whether b_i = 0 for i = 1,...,p.  The rationale for conducting such a test is
simple.  If event X is seen as causing event Y, then event X should precede Y
(Hamilton, p.303).  The test statistic is calculated from the sum of squared
residuals (RSS) of the unrestricted equation (above) and restricted equation
                 p
    y_t = c_0 + SUM g_i *y_t-i + D_t + e_t
                i=1
using the formula for joint-significance tests given by
    F = (RSS_0 - RSS_1)/p
        ------------------
        RSS_1 /(T -2p -1)
which is distributed as an F (p,T -2p -1) variable.  RSS_0 (RSS_1) is the
residual sum of squares of the restricted (unrestricted) regression.
The above test in only valid asymptotically due to the presence of a lagged
dependent variable in the regression.  An asymptotically equivalent test is
given by,
    F_a = T (RSS_0 - RSS_1)
          -----------------
               RSS_1
which is distributed as a chi2(p) variable.

References
Hamilton, J. D. (1994). Time Series Analysis. Princeton University Press. 799
  p.

Acknowledgements
Thanks to Carol Miu for helpful comments.

Author
Patrick Joly, Industry Canada
pat.joly@utoronto.ca

Also see
On-line:  help for test, vecar (if installed)

7
hzhil 发表于 2012-8-28 17:20:50
面板数据的格兰杰因果关系有没有现成的Stata命令哈?

8
zs一生有你 发表于 2012-8-29 11:24:27

9
zs一生有你 发表于 2012-8-29 11:25:36

10
静◆净 发表于 2012-12-27 11:05:27

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-29 02:51