Calculate Spearman and Pearson correlation on variables of different units If for example I have the following data
X     Y
3.2   0
1.5   0
6.5   3
2.4   1
6.2   3

where X is a value between 1 (best case) and 7 (worst case)
and Y is a value between 0 (best case) and 3 (worst case)
and I would like to compute Spearman or Pearson correlation between X and Y.
Do I need to convert into values with similar units?

The formula for correlation is $\rho_{X,Y} = \frac{E(XY)-E(X)E(Y)}{\sqrt{(E(X^2)-E(X)^2)(E(Y^2)-E(Y)^2}}, ~E(\cdot) $ is the expected value (basically, the average value). The units of an expected value of something are the same as the units of that something, so if we're just looking at the units, we can simplify that tp $\frac{XY-XY}{\sqrt{X^2Y^2}}=\frac{XY}{XY}=1$. The square of the correlation coefficient represents what portion of the total variance is the variables varying "together", as opposed to them varying separately. As a ratio between two things with the same units, it's dimensionless.
