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.

enter image description here

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?

enter image description here

With differencing:

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

enter image description here

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.

  • $\begingroup$ Possible duplicate of How to use Pearson correlation correctly with time series $\endgroup$
    – Dayne
    Sep 27 '19 at 9:25
  • $\begingroup$ What is CCF? It's not a common acronym, so please spell it out. $\endgroup$
    – Peter Flom
    Sep 27 '19 at 14:10
  • 2
    $\begingroup$ @Peter Flom, CCF stands for cross-correlation. In this case, I used R ccf (cross-correlation) function. $\endgroup$
    – Mark K
    Sep 27 '19 at 14:48
  • 2
    $\begingroup$ @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. $\endgroup$
    – whuber
    Sep 27 '19 at 19:26
  • 1
    $\begingroup$ steps for performing CCF explained here: stats.stackexchange.com/questions/418894/… $\endgroup$ Jul 25 '20 at 19:59

Found below in a book. Just post it here for reference in case it helps anyone.

According to Page 267, Time Series Analysis With Applications in R, Second Edition, by Jonathan D. Cryer • Kung-Sik Chan, Springer

"The specification of which lags of the covariate enter into the model is often done by inspecting the sample cross-correlation function based on the prewhitened data."

Prewhiten in R is different from Differencing. It seems Differencing shouldn't had been performed for this case.


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.