If I have two time series, say ice cream sales and temperature. What is the best method to determine if temperature drives ice cream sales so that it can be used as a predictor?

I've been reading that Peasrson correlation is not appropriate since it ignores the time factor which is assumed to be driving both series.

  • 1
    $\begingroup$ I think you might look for information on lagged correlation. $\endgroup$
    – TMBailey
    Oct 20, 2021 at 18:45

1 Answer 1


I think Pearson or Spearman correlation is the appropriate one. However, you need to map both variables to have the same timeseries first. Another way, you can use R square (coefficient of determination) score of both variables.

  • $\begingroup$ Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. $\endgroup$
    – Community Bot
    Oct 20, 2021 at 5:07
  • 1
    $\begingroup$ The problem with just testing correlation is that multiple causal relationships could give rise to the same correlation, so when you observe that daily temperature and daily ice cream sales are correlated you cannot tell whether ice cream sales cause warm temperatures, or vice versa, or whether some third factor causes them both. $\endgroup$
    – TMBailey
    Oct 20, 2021 at 18:50
  • $\begingroup$ All statistical method work like that. For example you can use any features to predict something using a regression model and when you access the result using Anova, you get confirmation about that even though from general knowledge there is no correlation among them. That's why you need to use general knowledge before implement any statistical method. Like a calculator, if you enter 2+3, the result will be 5. No matter what is 2 and 3. But if you put a general knowledge to 2 and 3 and you got that 2 is the number of chicken and 3 is the number of duck then the result can't. $\endgroup$
    – zonna
    Oct 22, 2021 at 2:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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