# CCF to show correlations between time series

2 time series, which looked like highly correlated. I want to prove it with CCF.

CCF stands for cross-correlation. In this case, I used R ccf (cross-correlation) function.

With direct CCF:

fe <- c(15,24,36,40,50,68,71,86,88,81,84,85,102,120,124,124,128,134)
ma <- c(317,331,347,353,368,382,395,411,417,418,454,460,469,480,493,503,516,522)

female <- ts(fe, frequency = 1, start=c(1950))
male <- ts(ma, frequency = 1, start=c(1950))

ccf(male, female)


Am I right here, they are highly correlated with zero lags?

With differencing:

ccf(diff(male), diff(female))


It shows no correlation.

What is the best way to find out the correlations between two time series?

p.s. This question is specifically related to CCF, from time series’ point of view and trying to understand if there's a lagging factor, not Pearson correlation.

Thannk you.

• Possible duplicate of How to use Pearson correlation correctly with time series Sep 27 '19 at 9:25
• What is CCF? It's not a common acronym, so please spell it out. Sep 27 '19 at 14:10
• @Peter Flom, CCF stands for cross-correlation. In this case, I used R ccf (cross-correlation) function. Sep 27 '19 at 14:48
• @Peter You're right: it doesn't hurt to spell out acronyms and abbreviations; and often that is necessary. But it's not always necessary to close a question that relies on one acronym whose meaning is readily inferred from the context. My test is this: if I don't know the subject but can easily guess the meaning of an acronym and confirm it with a quick Web search, it's probably safe to assume the question is understandable by those who know enough to answer it.
– whuber
Sep 27 '19 at 19:26
• steps for performing CCF explained here: stats.stackexchange.com/questions/418894/… Jul 25 '20 at 19:59