# Correlation between discrete and continuous data

I would like to caculate the correlation between two vectors. One vector represents the intensity of an emotion as continuous data between 0 and 100. The other vector represents the intensitiy of an emotion in 9 different steps (1 weakest, 9 strongest). I'm not sure if this is a discrete or categorical variable.

What meassure should I use in this case? Is Pearson the right way to go?

## 1 Answer

Because the scales are perhaps ordinal rather than numerical, I would suggest Spearman's correlation. [Because data are probably not normal, you should not trust any normal-based confidence intervals or tests provided by default in some statistical software packages.]

Below is a plot of 1000 fake data pairs $$(x,y),$$ sampled from a highly correlated bivariate distribution. In order to avoid massive over-plotting I have randomly jittered both variables. (Jittering is random uniform noise just for plotting purposes.)

R code:

cor(x, y, meth="sp")         # Spearman correlation
[1] 0.9164336

X = x + runif(1000, -.3,.3)  # uniform ...
Y = y + runif(1000, -.3,.3)  #  ... jittering
plot(X, Y, pch=20)