## Time series cross correlation with lag

Solved
Occasional Contributor
Posts: 13

# Time series cross correlation with lag

Hello, I want to check if some temperature data that I have are correlated, and I suspect there is a time-dependent lag.

I have tried the time-series analysis using cross correlation, but either I don't understand how to do it or something is wrong.

Finally I tested with the following data columns, where there should be full correlation for a lag of 7 rows:

A      A+7

1        8

2        9

3        10

4        11

etc.

What I got just doesn't make sense. There should be some way to see a full correlation of the data for a lag of 7.

Accepted Solutions
Solution
‎07-10-2017 04:02 PM
SAS Employee
Posts: 68

## Re: Time series cross correlation with lag

Hi, I received a response from one of my R&D colleagues:

EM 13.1 includes the cross-correlation analysis in TS Correlation node.

However, EM users can do   cross correlation analysis using proc timeseries if they have ETS license.

The following pseudo code will calculate cross-correlation between t1  and t2.

proc timeseries data=yourdata   outcrosscorr=_out ;

id  MNTH_YR interval=MONTH accumulate=TOTAL;

var  t1;

crosscorr CCF CCFNORM lag n / nlag=24 ;

crossvar  t2;

run;

All Replies
Solution
‎07-10-2017 04:02 PM
SAS Employee
Posts: 68

## Re: Time series cross correlation with lag

Hi, I received a response from one of my R&D colleagues:

EM 13.1 includes the cross-correlation analysis in TS Correlation node.

However, EM users can do   cross correlation analysis using proc timeseries if they have ETS license.

The following pseudo code will calculate cross-correlation between t1  and t2.

proc timeseries data=yourdata   outcrosscorr=_out ;

id  MNTH_YR interval=MONTH accumulate=TOTAL;

var  t1;

crosscorr CCF CCFNORM lag n / nlag=24 ;

crossvar  t2;

run;

Occasional Contributor
Posts: 13

## Re: Time series cross correlation with lag

Thank you.

I am looking for an answer in SAS JMP.

Unless I am doing somewhing wrong the Time Series lag correlation is not working.

I have tested Minitab, where it is working as it should.

SAS Employee
Posts: 68

## Re: Time series cross correlation with lag

Your welecome.  I would recommend the JMP Coomunity https://communities.sas.com/community/support-communities/jmp_software

If that doesn't work, try filing a Tech Support track at support.sas.com.  They can look at your code and walk you through any remediation steps.

Thanks,

Jonathan

🔒 This topic is solved and locked.