I have two variables which show significant correlation (Spearman). I would like to graphically show the strength of the relationship, much like showing a linear regression fit with confidence bands. What would be the best correct way of doing that?
1 Answers
Two options come to mind. What I would prefer is a scatter plot of X against Y with a non-parametric smoother, such as LOESS, to show the general trend between them. It doesn't directly correspond to a rank correlation, but since the Spearman correlation is a measure of monotonic trend, you can eyeball a non-parametric smooth curve to determine just how monotonic it is. Alternately, you can plot the data ranks on the X and Y axes and fit a linear regression line through it, because that's all the Spearman correlation is.
Note that Pearson correlation is directly related to the simple linear regression model, so plotting the fitted line with the p-value for the test of correlation would be much more concordant and easy to understand! The test of whether the pearson correlation is equal to zero is the same as the test for whether or not the slope parameter is equal to zero. This is one of many reasons that I favor using Pearson correlation over Spearman.

- 52,330
- 5
- 104
- 209
-
You could also fit a monotone spline – kjetil b halvorsen Oct 23 '18 at 00:17
-
@kjetilbhalvorsen I'm curious about this. Is there a way to fit a monotone spline with minimum R^2 on the original scale? – AdamO Oct 23 '18 at 16:19
-
An example of fitting a monotone spline: https://stats.stackexchange.com/questions/206073/looking-for-function-to-fit-sigmoid-like-curve/316446#316446 – kjetil b halvorsen Oct 23 '18 at 19:33