What is this?­

This tool calculates the Spearman Correlation Coefficient of data.

What is the Spearman Correlation?

The Spearman correlation measures the statistical dependence between two variables X and Y. It is defined as the Pearson correlation between the ranked variables.

It returns values between +1 and −1 inclusive.

  • 1 or −1 imply that Y is a monotone function of X.
  • 0 implies that there is no correlation between the variables.

The Spearman correlation coefficient is typically denoted by r, Spearman’s ρ or simply ρ.

How to use this Calculator

  • For two columns of data, copy and paste each one into the two text fields.
  • Alternatively, click on “Toggle one column,” copy two columns and paste data into the text field.

The correlation will be calculated automatically.

API

spearmancorrelation.com has a simple API to calculate the Spearman correlation coefficient.

API endpoint

https://spearmancorrelation.com/api/v2.groovy

Parameters

One of

  • t which contains an interleaved list of strings (one value of the first column, one value of the second column etc.)
  • t1 and t2 which contain the first and second column respectively

Use whitespace or newlines to separate values.

Output Types

Output depends on the Accept header you send. If you send application/xml, the output will be XML. Similarly for application/json (JSON output) and text/plain (plain text output).

JSON-P Mode

If you use a parameter called callback, you can use the API from remote domains.

Toggle one column

Visualization

Link to this webpage

Embed this graph

Toggle two columns
Toggle one column
That’s a strong correlation.
That’s a moderate correlation.
That’s a weak correlation.
This data is probably not correlated.