全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件
14060 9
2006-04-16
如何检验两个数据序列X、Y,是X引起Y还是Y引起X
二维码

扫码加我 拉你入群

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

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

全部回复
2006-4-16 17:43:00
eviews可以做
二维码

扫码加我 拉你入群

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

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

2006-5-16 13:12:00
I'm looking for a step-by-step explanation on how to perform a Granger causality test using SPSS, Mathematica, Java or Perl.
二维码

扫码加我 拉你入群

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

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

2006-5-16 13:13:00
This page contains some general Granger-information and a Granger causality test for SAS:

http://www.sas.com/rnd/app/examples/ets/granger/

If you're familiar with SAS then it's probably quite easy to port it to Mathematica. Help me do it!
二维码

扫码加我 拉你入群

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

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

2006-5-16 13:15:00
以下是引用hanszhu在2006-5-16 13:12:00的发言:
I'm looking for a step-by-step explanation on how to perform a Granger causality test using SPSS, Mathematica, Java or Perl.

Hello,
You need to understand 2 things to answer this:

First, you need to know what the Granger test is. Second, you need to know about the LAG function in SPSS. If you don't know how the Granger test works, request clarification, and I will tell you. (I have consulted Gujaratim D.N., 1995, Basic Econometrics, 3rd Ed. McGraw Hill, p620, to find out how to do the test.) The tricky part in SPSS is knowing about the LAG function. The lag of a variable is the score on the previous case in the dataset in SPSS,
so:

X lag(X)
3 6
6 7
7 2
2 [missing]

When you know this, the Granger test is straightforward. If that's not enough, request clarification, and I will add more.

Hope that helps,

二维码

扫码加我 拉你入群

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

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

2006-5-16 13:18:00
以下是引用hanszhu在2006-5-16 13:12:00的发言:
I'm looking for a step-by-step explanation on how to perform a Granger causality test using SPSS, Mathematica, Java or Perl.

After writing it, I realised you probably needed more than that, so here goes.

I will explain this in SPSS. Not everything can be done automatically, so you have to do a bit of work yourself. (That's the price you pay for using SPSS, not SAS.)

Say your two variables that you want to test the direction of causality are called A and B. Create a variable which is the lag of A (let's call it LAG_A) and another which is the lag of B (let's call it LAG_B. In SPSS syntax:

Compute lag_A = lag(A).
Compute lag_B = lag(A).

Now run a regression analysis, where A is the DV, and lag_A is the IV. This is the unrestricted resgression. Look at the residual sum of squares from this analysis, and call this RSS_r.

Now run another regression analysis, where A is the DV, and lag_A and lag_B are the IVs - this is the unrestricted analysis. Look at the residual sum of squares from this analysis, and call it RSS_ur.

Now, you need to calculate F:

F=((RSS_r-RSS_ur)/m)/(RSS_ur/(n-k))

Where m is the number of lagged terms - currently 1, but we will come back to that. n is the number of cases in the analysis (careful, because you have lost one, because of the lag), and k is the number of parameters in the unrestricted regression (i.e. 2 in this case.)

This F is distributed with m, n-k df.

You can include more lagged terms - lag_2a = lag(lag(A)), for example. Hence m will increase. Always include both the A and B lagged terms in the equation. You can also include other covariates - include them in both analyses. When you have done that, do it all again backwards. If one is significant, you have unidirectional causality. If both are, you have bidirectional causality (or feedback), if neither are, you have independence. I hope all that makes sense - if not request clarification.

It could be done in Jave or Perl, but you would need to either write, or find, the algorithms to do the appropriate matrix algebra - and that might be another question. You would also need to know the algebra to do, and that's probably another question yet.

二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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