# Correlation coefficient for sets with non-linear correlation

What method can I use to test if there is a correlation between two sets of data? The correlation coefficient works if there is a linear association, but if I have two sets that are clearly (visually by graph) correlated in a non-linear way, how can I test that? Is there a coefficient or a special method?

• en.wikipedia.org/wiki/Distance_correlation – ttnphns Jun 4 '14 at 14:33
• One small note: if you test for something because you had discovered it previously (eg, in a graph), the test is not truly valid. – gung - Reinstate Monica Jun 4 '14 at 14:39
• What is the nature of the non-linearity? Is the relationship monotonic, eg? – gung - Reinstate Monica Jun 4 '14 at 14:40
• no its not monotonic – AnarKi Jun 5 '14 at 8:12
• Can you put the rather crucial information that it's not monotonic in your question? Can you plot the data? – Glen_b -Reinstate Monica Jul 7 '14 at 15:04

In case of non-linear correlation Spearman's Rank-correlation is one method

and one more method is called Kendall's Tau

R code for Spearman's rank correlation:

cor(X, Y ,method= "spearman")


R code for Kendall's rank correlation:

cor(X, Y ,method= "kendall")