1
$\begingroup$

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?

$\endgroup$

1 Answer 1

1
$\begingroup$

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!

$\endgroup$
5
  • $\begingroup$ This might help: medium.com/@outside2SDs/… $\endgroup$
    – Timelate
    Apr 20, 2022 at 9:04
  • $\begingroup$ Thanks for your answer Timelate. In your posted link it is said about your suggested approaches ANOVA and Kruskal Wallis test "I should point out that though ANOVA or Kruskal-Wallis test can tell us about statistical significance between two variables, it is not exactly clear how these tests would be converted into an effect size or a number which describes the strength of association." As far as I understand, this means, that they can't really quantify the degree of dependece between the two variables. Do you know approaches that can do that? $\endgroup$
    – PeterBe
    Apr 20, 2022 at 12:07
  • $\begingroup$ Hi PeterBe, I would then maybe go the the logistic regression, even though it is not a measure of correlation sensus stricto (quantifying the relationship between two variables) but more a measure of how well one variable can be used to predict the other... $\endgroup$
    – Timelate
    Apr 21, 2022 at 13:30
  • $\begingroup$ Thanks for your answer. Then I will try logistic regression. I accepted and upvoted your answer. $\endgroup$
    – PeterBe
    Apr 21, 2022 at 13:49
  • $\begingroup$ Please see stats.meta.stackexchange.com/questions/6304/my-upvoting-policy, when you find a question sufficiently clear to write an answer, consider to upvote the question! $\endgroup$ Apr 22, 2022 at 16:37

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.