I'm trying to find a test to establish the correlation between a certain value of a substance measured inside the skin (continuous: 0,65 or 1,15 etc.) and the bacterial load found on the skin (ordinal: Negative, load 1, load 2, load 3, load 4) Which test is most suited to do this?
2 Answers
My suggestion is to use a Spearman’s rank-order correlation (for example see here ), so that the continuous variable will be re-expressed as a ranked variable (so for each observation you will take its ordinal rank compared to the rest of the observations in the sample) and its rank will be comparable to the rank of the ordinal variable. However make sure to express the ordinal variable correctly in numerical terms. For example use 0,1,2,3 etc. Because all the variables used must be numerical.
In my opinion, for your inference problem it makes more sense to ask "how much is the link between the two quantities?" rather than "Are the two quantities correlated or not?". Because we may always expect some kind of link or connection between them.
If you're willing to accept this slightly different way of looking at the problem, and if you have many data, one way to quantify the link is via the mutual information between the quantities $x$ (continuous) and $d$ (discrete):
You start with the empirical joint distribution $p(x,d)$ that you found from your measurements. Then you calculate the marginal distribution for each quantity: $$p(x) := \sum_d p(x,d), \qquad p(d) := \sum_x p(x,d).$$ Their mutual information is $$I(x,d) := \sum_{x,d} p(x,d)\log\frac{p(x,d)}{p(x)\;p(d)}. $$ This measure is always positive, and it's zero only if the probability distributions for the two quantities are independent, $p(x,d)=p(x)\;p(d)$. So the smaller the mutual information, the less the two quantities are linked. The advantage of this measure is that it doesn't care whether the link between the two quantities is linear, quadratic, log-linear, or whatnot – that's why I was speaking of a "link" rather than "correlation" (which usually people intend as linear correlation).
See for example https://m-clark.github.io/docs/CorrelationComparison.pdf.
A deeper analysis can be made (using probabilistic models and so on), but this can be a starting point.
-
$\begingroup$ Why do you take $\dfrac{p(x,d)}{p(x)p(d)}$ instead of $\dfrac{p(x)p(d)}{p(x,d)}$? $\endgroup$– DaveAug 20, 2019 at 14:22
-
$\begingroup$ This is the standard definition (see for example the wikipedia article <en.wikipedia.org/wiki/Mutual_information> and especially the references there). The difference would only be a minus sign, since $\log(1/x)=-\log(x)$. With its standard definition, the mutual information is never negative. With your definition it would be never positive. $\endgroup$– pglpmAug 20, 2019 at 18:09