# Cross Correlations Reversed - SPSS and R

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.

• Look at your data. Are the data the same? Or was there an error when moving between R and SPSS? – Jeremy Miles Mar 28 at 17:36
• 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 – logisticregress Mar 28 at 17:42

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.