全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
14662 12
2010-11-16
悬赏 30 个论坛币 未解决
各位大侠:
       我现在想要做panel data的格兰杰因果检验,该怎么做啊? 求高人指点。 最好能告诉命令是什么,中间的步骤。
       比如 n家公司10年对应的 y  x  这样的panel data 如何做。
       我在 tsset  公司名称  年份代码
       后 用 gcause 等命名 都说这样的命令不能用在panel data上,急,求高人指点。
二维码

扫码加我 拉你入群

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

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

全部回复
2010-11-16 10:25:16

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

[biggrin] [biggrin]
二维码

扫码加我 拉你入群

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

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

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。

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

扫码加我 拉你入群

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

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

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

扫码加我 拉你入群

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

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

2010-11-16 11:09:35
2# rosenbloog
哎呀 忘记了
二维码

扫码加我 拉你入群

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

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

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)
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群