How do I know when to choose between Spearman's $\rho$ and Pearson's $r$? My variable includes satisfaction and the scores were interpreted using the sum of the scores. However, these scores could also be ranked.
If you want to explore your data it is best to compute both, since the relation between the Spearman (S) and Pearson (P) correlations will give some information. Briefly, S is computed on ranks and so depicts monotonic relationships while P is on true values and depicts linear relationships.
As an example, if you set:
x=(1:100); y=exp(x); % then, corr(x,y,'type','Spearman'); % will equal 1, and corr(x,y,'type','Pearson'); % will be about equal to 0.25
This is because $y$ increases monotonically with $x$ so the Spearman correlation is perfect, but not linearly, so the Pearson correlation is imperfect.
corr(x,log(y),'type','Pearson'); % will equal 1
Doing both is interesting because if you have S > P, that means that you have a correlation that is monotonic but not linear. Since it is good to have linearity in statistics (it is easier) you can try to apply a transformation on $y$ (such a log).
I hope this helps to make the differences between the types of correlations easier to understand.
Shortest and mostly correct answer is:
Pearson benchmarks linear relationship, Spearman benchmarks monotonic relationship (few infinities more general case, but for some power tradeoff).
So if you assume/think that the relation is linear (or, as a special case, that those are a two measures of the same thing, so the relation is $y=1\cdot x+0$) and the situation is not too weired (check other answers for details), go with Pearson. Otherwise use Spearman.
This happens often in statistics: there are a variety of methods which could be applied in your situation, and you don't know which one to choose. You should base your decision the pros and cons of the methods under consideration and the specifics of your problem, but even then the decision is usually subjective with no agreed-upon "correct" answer. Usually it is a good idea to try out as many methods as seem reasonable and that your patience will allow and see which ones give you the best results in the end.
The difference between the Pearson correlation and the Spearman correlation is that the Pearson is most appropriate for measurements taken from an interval scale, while the Spearman is more appropriate for measurements taken from ordinal scales. Examples of interval scales include "temperature in Fahrenheit" and "length in inches", in which the individual units (1 deg F, 1 in) are meaningful. Things like "satisfaction scores" tend to be of the ordinal type since while it is clear that "5 happiness" is happier than "3 happiness", it is not clear whether you could give a meaningful interpretation of "1 unit of happiness". But when you add up many measurements of the ordinal type, which is what you have in your case, you end up with a measurement which is really neither ordinal nor interval, and is difficult to interpret.
I would recommend that you convert your satisfaction scores to quantile scores and then work with the sums of those, as this will give you data which is a little more amenable to interpretation. But even in this case it is not clear whether Pearson or Spearman would be more appropriate.
I ran into an interesting corner case today.
If we are looking at very small numbers of samples, the difference between Spearman and Pearson can be dramatic.
In case below, the two methods report an exactly opposite correlation.
Some quick rules of thumb to decide on Spearman vs. Pearson:
- The assumptions of Pearson's are constant variance and linearity (or something reasonably close to that), and if these are not met, it might be worth trying Spearman's.
- The example above is a corner case that only pops up if there is a handful (<5) of data points. If there is >100 data points, and the data is linear or close to it, then Pearson will be very similar to Spearman.
- If you feel that linear regression is a suitable method to analyze your data, then the output of Pearson's will match the sign and magnitude of a linear regression slope (if the variables are standardized).
- If your data has some non-linear components that linear regression won't pick up, then first try to straighten out the data into a linear form by applying a transform (perhaps log e). If that doesn't work, then Spearman may be appropriate.
- I always try Pearson's first, and if that doesn't work, then I try Spearman's.
- Can you add any more rules of thumb or correct the ones I have just deduced? I have made this question a community Wiki so you can do so.
p.s. Here is the R code to reproduce the graph above:
# Script that shows that in some corner cases, the reported correlation for spearman can be # exactly opposite to that for pearson. In this case, spearman is +0.4 and pearson is -0.4. y = c(+2.5,-0.5, -0.8, -1) x = c(+0.2,-3, -2.5,+0.6) plot(y ~ x,xlim=c(-6,+6),ylim=c(-1,+2.5)) title("Correlation: corner case for Spearman vs. Pearson\nNote that they are exactly opposite each other (-0.4 vs. +0.4)") abline(v=0) abline(h=0) lm1=lm(y ~ x) abline(lm1,col="red") spearman = cor(y,x,method="spearman") pearson = cor(y,x,method="pearson") legend("topleft", c("Red line: regression.", sprintf("Spearman: %.5f",spearman), sprintf("Pearson: +%.5f",pearson) ))
While agreeing with Charles' answer, I would suggest (on a strictly practical level) that you compute both of the coefficients and look at the differences. In many cases, they will be exactly the same, so you don't need to worry.
If however, they are different then you need to look at whether or not you met the assumptions of Pearson's (constant variance and linearity) and if these are not met, you are probably better off using Spearman's.