Correlation – How to Measure the Correlation Between a Nominal and an Interval Variable?

correlation

I have a dataset with 5 features: timestamp, value , temperatures, hour of the day, day of the week and I would like to know if there is a way to measure the 'correlation' or something similar between a nominal and an interval variable. For example I would like calculate the correlation between the 'temperatures' (in °C) and 'hour of the day' or 'day of the week'. When transforming the 'days of the weeks' and the 'hours of the days' in numbers as I did in this table, the results don't make that much sense if you compute the normal correlation as 'hour of the day' and 'day of the week' are nominal variables basically:

enter image description here

What I want to find out is just whether there is a dependency between the different values of these variables. It does not have to be a linear dependency as in the normal correlation. Any suggestion about the most common way of doing this?

Best Answer

I suppose you could try a a one-way ANOVA or non parametric Kruskal-Wallis H test. A logistic regression might be useful too.

These are quite common approaches to look a the relationship between one categorical (i.e day of the week / hour of the day) vs one continuous variable (i.e. Temperature)

Hope this helps!