How this calculator works
Pearson measures how consistently the original values follow a straight line. Spearman applies Pearson to average ranks and can detect monotonic patterns that are curved in the original scale. Tied observations receive their average occupied rank. Lists must have equal lengths and each variable must vary. The paired table shows exactly which original values or ranks enter the calculation.
Formula
r = Σ((x - meanX)(y - meanY))/sqrt(Σ(x - meanX)² Σ(y - meanY)²). Spearman uses ranks in place of x and y.
Worked example
For x = 1, 2, 3 and y = 2, 4, 6, Pearson r = 1. Reversing the y ranks to 3, 2, 1 gives Spearman correlation -1.
Advertisement
Frequently asked questions
Does a zero coefficient prove independence?
No. A curved or non-monotonic relationship may have zero Pearson or Spearman correlation.
What does the squared coefficient mean?
For a simple linear regression with an intercept, squared Pearson r equals R squared. Squared Spearman correlation describes ranks instead.
Can I infer causation?
No. Confounding, selection and coincidence can create an association. Inspect the context and a scatter plot.