Clarification of Answer by
17 Jun 2002 11:18 PDT
After writing it, I realised you probably needed more than that, so
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:
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.