0
$\begingroup$

I'm wondering if anyone else has noticed that cross-correlations are reversed between SPSS and R. Here is an example of the exact same data run in both R and SPSS (V23). Note how the the axis is reversed. So, which one is right? In the R version, one might interpret it as X leading Y, while SPSS one might interpret it as X lagging Y.

This post also might help answer, but I'm not sure sure it actually applies.

any insight/experience appreciated.

R Cross Correlation Output (>>ccf(x,y)) enter image description here

$\endgroup$
  • $\begingroup$ Look at your data. Are the data the same? Or was there an error when moving between R and SPSS? $\endgroup$ – Jeremy Miles Mar 28 at 17:36
  • $\begingroup$ it is exactly the same data. both variables have been differenced, so like this: ccf(diff(x), diff(y)). same in SPSS. If anyone has access to both R and SPSS, and would like to try, here is a link to Google Drive with the sample data: drive.google.com/open?id=1Iy2LqHsDbkPbV1zb7jBkE-1jl4Z40NDA $\endgroup$ – logisticregress Mar 28 at 17:42
1
$\begingroup$

For anyone interested, I may have answered my own question.

SPSS writes:

"The basic specification is two or more series names. By default, CCF automatically displays the cross-correlation coefficient and standard error for the negative lags (second series leading), the positive lags (first series leading), and the 0 lag for all possible pair combinations in the series list. It also plots the cross-correlations and marks the bounds of two standard errors on the plot. By default, CCF displays and plots values up to 7 lags (lags −7 to +7), or the range specified on TSET."

which I re-wrote to work with my brain:

By default, CCF automatically displays the cross-correlation coefficient and standard error for:

  1. the negative lags (y leading x)
  2. the positive lags (x leading y)
  3. and the 0 lag for all possible pair combinations in the series list

It also plots the cross-correlations and marks the bounds of two standard errors on the plot. By default, CCF displays and plots values up to 7 lags (lags −7 to +7), or the range specified on TSET.

there is also a good reference here, which seems to support this assertion, and indicates that R is correctly displaying the x lags on the negative (left) side of the ccf output.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.