# Can I use all correlation metrics also for time series?

#### JohnMeier

##### New Member
I was using the cross correlation function in R (ccf) until now to discover correlations and lags between two time series.

I was wondering if I can use all other correlation metrics for time series as well or are there any restrictions with time series? For example I want to use Spearman's rank correlation coefficient to compare two ordinal scaled time series, is that a valid approach and can I use it to detect lags as well? The same for nominal scaled time series (events like on/off or status) like phi or Cramers V?

Thanks!

#### noetsi

##### No cake for spunky
If the series trend together, and often they will in time series, then you will get spurious regression characterized by very high [and very wrong] R squared. I would think this would influence any correlation although I have not seen specific measures brought up. What I have seen brought up is the comment that you should not perform regression on time series data as if it was cross sectional if you have any autoregressive elements. Instead you conduct something like regression with autoregressive error (or ARIMA with input variables).

A separate, very important, issue is that commonly a predictor at time t will influence levels of the dependent variable at multiple lags (that is t+1, t+2 etc). So distributed lag models are reccomended if complex.

#### JohnMeier

##### New Member
Ok thanks. What would be a proper approach to measure a correlation between a binary signal (or ordinal/nominal) and a continous variable. Let's say I want to find out if a switch influences the temperature in my room (and vice versa)? Can I calculate cross calculation here?

#### noetsi

##### No cake for spunky
Yes this is essentially cross section (although it is never a bad idea to test for autoregression with a Durbin Watson or better yet more complex test).

It does not matter what type of data the predictors are (continuous, ordinal, nominal) only the form of the dependent (predicted) variable. Temperature which is your predicted variable I think, is continuous. You could run a t test or linear regression to do this (they are essentially the same thing although a t test won't show you how much the change is).

Regression, nearly all statistics, assumes your predictors influence the predicted variable. Not that the predicted variable influence the predictors. If the switch is influencing the temperature and the temperature is influencing the switch (commonly referred to as feedback) you have violated the assumptions of all these methods. The only technique I know of which will address this is structural equation models which is considerably more complex than regression.