# Correlation between scale and categorical variable [duplicate]

This question already has an answer here:

I am trying to find the correlation or association between a categorical variable - classes from 1 -4 from a GIS (geographic information system) classification - and a continuous variable with values between 0 and 9. What would be the best test to use for this?

## marked as duplicate by kjetil b halvorsen, mdewey, gung♦, Peter Flom♦May 22 '17 at 12:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

• Is your continuous variable really continuous or discrete? That is, can it take values such as 2.5, or only 0, 1, 2, ...? – Stephan Kolassa Aug 23 '13 at 8:02
• The values can range anywhere between 0 - 9, ie values of 1.6, 1.65, 1.7. – Bee Aug 23 '13 at 8:18

## 1 Answer

There are a few options.

1. Perform an analysis of variance (ANOVA) on the continuous variable separated into the modalities of the categorical variable. The idea is to look at the variance of the continuous variable within each class $s_i$ and compare it to the total variance $s_t$. The correlation coefficient for one class compared to the total is then $\eta_i = \sqrt{s_i / s_t}$
2. Perform a multimodal regression of the continuous variables, predicting for the categorical variable.

I can't tell you the codes, though, as I'm not familiar with SPSS.

• ANOVA makes sense, +1. Be careful about inference, though, as it does not sound like residuals will be normally distributed, the continuous variable being limited to [0,9]. – Stephan Kolassa Aug 23 '13 at 8:04
• Bit of a newby to stats, but would it also be possible to use a non parametric test, for example a Kruskal-Wallis test, given my data? – Bee Aug 23 '13 at 9:50
• Kruskal-Wallis would be appropriate if your question is "is my continuous variable distributed differentially between my GIS groups?" If you are looking for correlations or associations, Kruskal-Wallis will not really help you. So: do use @Drew75's solution for strengths of associations, but if you are tempted to do statistical inference (tests for significance), first check whether your residuals are "sufficiently" normally distributed - if they are not, use Kruskal-Wallis. – Stephan Kolassa Aug 24 '13 at 18:55