Spearman Rank Correlation Calculator
Paste two or more columns of numbers and get Spearman's rho (rs) with every rank, d and d² shown step by step, the p-value, an exact permutation test, the critical value, confidence intervals, a correlation matrix for 3+ variables, four charts and an APA write-up you can copy.
⚡ 0. Quick Answer
A Spearman rank correlation calculator ranks each variable, finds the rank difference d for every pair, and returns rs = 1 − 6Σd² ÷ [n(n² − 1)].
Rho runs from −1 to +1 and measures how steadily two variables rise or fall together, even when the trend is curved. For 10 students with Σd² = 8, rs = 1 − 48 ÷ 990 = 0.95, p < .001.
Rule of thumb: |rs| below 0.30 is weak, 0.30 to 0.49 moderate, 0.50 to 0.69 strong, and 0.70 or more very strong. Use Spearman instead of Pearson when the data are ranks, Likert scores, skewed, or have outliers.
🔑 Key Takeaways
- The Spearman rank correlation calculator gives rs between −1 and +1, where 0 means no monotonic link.
- It works on ranks, so it suits ordinal data, skewed data and data with outliers, and it needs at least 5 pairs.
- With tied values, the shortcut 1 − 6Σd² formula is only approximate; the exact rho is Pearson r on the average ranks, which this tool uses.
- For n below 10, trust the exact permutation p-value and the exact critical table, not the t approximation.
- A rho near 0 can hide a strong U-shaped relationship, so always look at the scatter plot.
📚 1. What Is Spearman's Rank Correlation?
Spearman's rank correlation coefficient, written rs or the Greek letter rho (ρ), measures the strength and direction of a monotonic relationship between two variables. Monotonic means that as one variable goes up, the other keeps going in one direction, always up or always down. The line does not need to be straight. Charles Spearman introduced it in 1904 to compare rankings in psychology.
The idea is simple. Replace each value with its rank (1 for the smallest, 2 for the next, and so on). Then measure how well the two lists of ranks agree. If the ranks match perfectly, rs = +1. If one list is the exact reverse of the other, rs = −1. If the ranks are unrelated, rs is close to 0.
What it measures:
- Direction: a positive sign means both rank orders go the same way; a negative sign means they go opposite ways.
- Strength: the size of rho, from 0 (none) to 1 (perfect).
- Significance: the p-value tests H0: the population rho is 0, against H1: it is not 0 (or above 0, or below 0 for a one-tailed test).
A worked one-liner: ten students sit a maths and a physics exam. After ranking both scores, the rank differences are 1, −1, −1, 1, 1, 1, 0, −1, 0 and −1. Squared and added, Σd² = 8, so rs = 1 − (6 × 8) ÷ (10 × 99) = 0.9515. Good maths students are almost always good physics students.
Who uses it: psychologists and educators correlate Likert scales and test ranks. Ecologists link habitat measures to species counts, which are skewed. Clinicians relate dose to response when the curve flattens. Market researchers compare satisfaction scores. Judges and panels check how well their rankings agree. In finance, the rank information coefficient (IC) between a factor and next-period returns is a Spearman correlation.
| Feature | Spearman's rho (rs) | Pearson's r | Kendall's tau-b |
|---|---|---|---|
| Measures | Monotonic trend in ranks | Straight-line trend in raw values | Share of concordant minus discordant pairs |
| Data type | Ordinal, interval or ratio | Interval or ratio | Ordinal, interval or ratio |
| Needs normality? | No | Yes, for the p-value | No |
| Effect of an outlier | Small | Can be very large | Small |
| Many ties | Fine with average ranks | Not relevant | Often preferred |
| Typical size | Close to r for linear data | Reference | About two-thirds of rho |
🧮 2. Set Up Your Data
Type one value per cell. Each column is a variable and each row is one case. Empty cells become NA and that row is dropped from any pair that needs it.
📊 3. Results
🧠 4. Interpretation of Results, In Detail
4.1 What the value of rho tells you
Rho answers one question: when the cases are put in order by X, are they also in order by Y? A rho of +1 means the two orders are identical. A rho of −1 means one order is the exact reverse of the other. A rho of 0 means knowing a case's rank on X tells you nothing about its rank on Y.
The sign gives the direction and the size gives the strength. A rho of −0.80 is just as strong as +0.80; it only points the other way. Never call a negative correlation "weak" because the number is below zero.
4.2 How strong is my correlation? The size bands
This calculator uses these bands for |rs|: below 0.10 negligible, 0.10 to 0.29 weak, 0.30 to 0.49 moderate, 0.50 to 0.69 strong, and 0.70 or more very strong. They follow Cohen's 0.1, 0.3 and 0.5 effect-size guide, with an extra top band. Other fields use other cut-offs; Schober and colleagues (2018), for example, treat 0.40 to 0.69 as moderate in medicine. State which bands you used.
The bands are a guide, not a law. A rho of 0.25 between a cheap screening question and a disease can matter a lot. A rho of 0.60 between two versions of the same test may be disappointing, because you expected agreement above 0.90.
4.3 Reading the p-value correctly
The p-value is the chance of seeing a rho at least this far from zero if the true population rho were zero. A small p-value (below your alpha, usually 0.05) says chance alone is an unlikely explanation. It does not tell you how big the correlation is. With 500 pairs, a rho of 0.10 can be significant; with 6 pairs, a rho of 0.80 can fail.
The tool gives two p-values. The t approximation uses t = rs√[(n − 2)/(1 − rs²)] with n − 2 degrees of freedom; it is what SciPy and SPSS report and is accurate from about n = 10. The permutation p-value shuffles the pairing many times (or checks every possible ordering when n is 10 or less) and counts how often a rho as extreme appears. For small samples, report the permutation value.
4.4 The confidence interval tells you the plausible range
The confidence interval is the range of population rho values that fit your data. The tool uses the Fisher z transformation, z = artanh(rs), with the Bonett and Wright (2000) standard error √[(1 + rs²/2)/(n − 3)], which is a little wider than the Pearson version because ranks carry less information. It also gives a bootstrap percentile interval from 2,000 resamples, which makes no distribution assumption.
If the interval excludes zero, the result is significant. If it is wide, for example 0.10 to 0.85, the true strength could be anything from weak to very strong, and you should say the estimate is imprecise.
4.5 rs²: the shared rank variance
Squaring rho gives the share of variation in one set of ranks that lines up with the other. A rho of 0.70 gives rs² = 0.49, so about half of the rank order is shared. It is a helpful way to show readers that a "strong" 0.50 still leaves three-quarters of the ranking unexplained. Note that rs² describes ranks, not raw values, so do not call it "variance explained in Y".
4.6 Tied ranks and why two formulas can disagree
When two values are equal, each gets the average of the ranks they would share. Two values in 3rd and 4th place both get 3.5. With ties, the popular shortcut 1 − 6Σd²/[n(n² − 1)] is no longer exact, because it assumes the ranks are 1, 2, 3 and so on with no repeats. The exact answer is Pearson's r calculated on the average ranks. SciPy, R, SPSS and this tool all use that exact version, and the results table shows both so you can see the gap.
The gap is usually tiny. On a 1 to 7 Likert scale with 15 people it can reach 0.01 or more. If your teacher uses the shortcut by hand, that explains why your answer differs slightly from the software.
4.7 Spearman versus Pearson on the same data
The tool reports Pearson's r beside rho. If the two are close, the trend is close to a straight line and either is fine. If rho is clearly higher than r, the trend is curved but steady, or a few outliers are pulling Pearson down. If r is higher than rho, a few extreme points may be creating a straight-line look that the bulk of the data does not share. A gap of 0.2 or more is flagged in the assumption table.
4.8 Decision guide
| Your result | What to conclude | What to write |
|---|---|---|
| p < α and the CI excludes 0 | A real monotonic link, size given by rho | "a significant strong positive correlation, rs(8) = .95, p < .001" |
| p < α but |rho| < 0.20 | Real but small; often only because n is large | Report it as weak and discuss practical importance |
| p just above or below α, two p-values disagree | Borderline evidence | Give both p-values and the CI; avoid a firm claim |
| p > α and a wide CI | Not enough data to judge | "no significant correlation was found"; never "no relationship exists" |
| rho near 0 but the scatter plot is curved | A non-monotonic relationship | Describe the shape and use a curve or polynomial model |
| rho = ±1 | Perfect rank agreement | Check for duplicate or derived variables first |
4.9 Correlation is not causation
A strong rho shows that two rank orders move together. It does not show that X causes Y. A third variable can drive both: ice cream sales and drowning both rise with temperature. Time trends, selection effects and reverse causation are other common reasons. Only a controlled experiment or a careful causal design can support a causal claim.
4.10 Common mistakes this calculator prevents
- Unpaired data: the tool refuses to run if the variables have different lengths, so rows cannot slip out of line.
- Wrong tie handling: it always uses average ranks and the exact tie-corrected rho.
- Trusting the t p-value at small n: it adds an exact or permutation p-value and warns when n is below 10.
- Hidden U-shapes: it splits the data at the middle of X and warns if the direction reverses.
- Too many tests: with 3 or more variables it applies the Holm correction to every pair in the matrix.
- Reporting rho without a range: it always gives a confidence interval and the sample size needed for 80% power.
✍ 5. How to Write Your Results in Research
When reporting Spearman rank correlation results in APA format, give the coefficient, the degrees of freedom (n − 2), the exact p-value, and ideally a confidence interval. Use the italic symbol rs and drop the leading zero (.95, not 0.95), because rho cannot be larger than 1.
▶ Run the analysis above to auto-fill all five examples with your results.
📌 Key conventions for this style
- Write rs(df) = .xx, where df = n − 2.
- Give the exact p to three decimals; use p < .001 for very small values.
- No leading zero for rho or p, because neither can exceed 1.
- Add the 95% CI in square brackets after the p-value.
📌 Key conventions for this style
- Justify why Spearman was chosen over Pearson: ordinal data, skew, outliers or a curved trend.
- Say how ties were handled and whether the test was one- or two-tailed.
- Report a second coefficient (Pearson or Kendall) if examiners may ask.
- Name the software and version.
📌 Key conventions for this style
- Use "go up together" or "go in opposite directions" instead of symbols.
- Say how strong the link is in words.
- Always add that a correlation does not prove cause and effect.
- Keep it to two or three short sentences.
📌 Key conventions for this style
- Keep the Objective, Methods, Results, Conclusion order.
- Put n and the test type in Methods, numbers only in Results.
- On a poster, show the scatter plot (Chart 1) next to the numbers.
- Keep decimal places the same across every coefficient.
📌 Key conventions for this style
- State the direction of the hypothesis before seeing the data.
- Fix alpha, the tails and the tie rule in advance.
- Report the sample size needed for 80% power.
- Share data and code so others can rerun the exact rho.
5.1 Reporting a correlation matrix
With three or more variables, put rho values in a lower-triangle table, mark significance with asterisks, and state the multiple-comparison correction in a note under the table, for example: "Spearman correlations, n = 12. * p < .05 after Holm correction for 3 tests."
5.2 Reporting a non-significant result
Write: "There was no statistically significant correlation between X and Y, rs(18) = .34, p = .145, 95% CI [−.14, .69]." Never write "there is no relationship"; the wide interval shows a moderate link is still possible.
∑ 6. Formulas Used
These are the exact formulas behind every number in the results. They are listed from the coefficient itself outward to the test, the interval and the sample size plan.
🔀 7. Spearman Rank Correlation Calculation Flowchart, Step by Step
This flowchart shows how the Spearman rank correlation is calculated, step by step, from two raw columns to a tested, reportable rho. Every box uses the same worked example as the Excel, R and Python sections: the maths and physics exam scores of 10 students.
Check any box yourself: the Excel sheet in Section 9, the R script in Section 10 and the Python script in Section 11 all return Σd² = 8, rs = 0.9515 and t = 8.749 for this dataset.
📝 8. How to Use This Spearman Rank Correlation Calculator
- Enter your data. The default tab takes comma-separated numbers, exactly as the placeholder shows:
52, 48, 55, 61, 47, ...Spaces, tabs, semicolons and new lines also work, so a column pasted from Excel is fine. - Name each variable. The name box above every textarea is editable. Type something clear such as Maths score; it flows into the results, the charts, the matrix and every reporting sentence.
- Keep the pairs lined up. The first value in every box belongs to case 1, the second to case 2, and so on. Type NA for a missing value instead of deleting it, so the rows stay matched.
- Add more variables if needed. Press Add variable to include a third or fourth column. With three or more, the calculator builds a Spearman correlation matrix with Holm-adjusted p-values.
- Or upload a file. On the Upload tab choose a CSV or Excel file and click the columns you want. Every column you click becomes its own variable with its header as the name.
- Try a sample dataset. Ten built-in datasets show a textbook case, strong negative data, tied Likert scores, a three-variable ecology matrix, a curved dose response, an outlier, a small sample, a weak result, two judges ranking contestants, and a U-shape where Spearman fails.
- Pick the pair and the test settings. Choose which two variables get the detailed output, the significance level and whether the test is two-tailed or one-tailed.
- Press Run Spearman Test. Nothing is computed until you do, and changing any input clears the old results so you never read stale numbers.
- Read the results. Start with the verdict line, then rho, both p-values and the confidence interval. The rank table shows every rank, d and d squared, and the assumption checks flag small samples, ties, outliers and U-shapes.
- Check the charts and export. Look at Chart 1 for the shape of the data, then copy a ready-made write-up from Section 5 or download the report as a text file or PDF.
Worked example: load sample 1, press Run, and you should see rs = 0.95, Σd² = 8, t(8) = 8.75 and p < .001, the same numbers as the flowchart in Section 7.
📈 9. How to Calculate Spearman Rank Correlation in Excel
Excel has no SPEARMAN function, which surprises most people. The fix is easy: rank each column with RANK.AVG, then run CORREL on the two rank columns. That gives the exact, tie-corrected rho. This section also builds the d and d² columns so you can show the hand calculation, and finishes with the t statistic and p-value.
=RANK.AVG(A2,$A$2:$A$11,1) in C2 and =RANK.AVG(B2,$B$2:$B$11,1) in D2, fill both down, then type =CORREL(C2:C11,D2:D11). That is Spearman's rho.9.1 The functions you need
| You want | Excel formula | Note |
|---|---|---|
| Rank with ties averaged | =RANK.AVG(A2,$A$2:$A$11,1) | The last argument 1 means ascending, smallest = 1 |
| Spearman rho (exact) | =CORREL(C2:C11,D2:D11) | Pearson r on the rank columns |
| Rank difference d | =C2-D2 | Fill down to row 11 |
| Sum of d² | =SUMSQ(E2:E11) | Or square in column F and use SUM |
| Shortcut rho | =1-6*F12/(10*(10^2-1)) | Exact only without ties |
| t statistic | =I5*SQRT((I2-2)/(1-I5^2)) | I5 holds rho, I2 holds n |
| Two-tailed p-value | =T.DIST.2T(ABS(I6),I2-2) | Needs a positive t, hence ABS |
RANK.AVG, which gives both 3.5.9.2 Step by step
1 Put each variable in its own column
Type the paired values side by side, one student per row, with a header in row 1. Maths goes in column A and physics in column B. Keep each pair on the same row.
A2:A11 and B2:B11The 10 maths scores are in A2:A11 and the matching physics scores in B2:B11.
2 Rank each column with RANK.AVG
In C2 type the rank formula for maths, and in D2 the same formula for physics pointing at column B. Select C2:D2 and double-click the fill handle to copy it down.
=RANK.AVG(A2,$A$2:$A$11,1) =RANK.AVG(B2,$B$2:$B$11,1)C2 returns 4 because 52 is the 4th lowest maths score. D2 returns 3. The dollar signs keep the range fixed as you fill down.
3 Work out d and d², then add them up
In E2 type =C2-D2 and in F2 type =E2^2. Fill both down, then add the d² column in F12.
=C2-D2 =E2^2 =SUM(F2:F11)The d column is 1, −1, −1, 1, 1, 1, 0, −1, 0, −1. Every d² is 0 or 1, so F12 = 8.
4 Calculate rho two ways
Build a small summary block in columns H and I. Type n in I2 with =COUNT(A2:A11) and copy F12 into I3. The shortcut goes in I4 and the exact version in I5.
=1-6*I3/(I2*(I2^2-1)) =CORREL(C2:C11,D2:D11)Both I4 and I5 show 0.9515, because there are no ties. With ties, trust I5.
5 Get the t statistic and the p-value
In I6 type the t formula and in I7 the two-tailed p-value. For a one-tailed test use =T.DIST.RT(I6,I2-2) when you predicted a positive rho.
=I5*SQRT((I2-2)/(1-I5^2)) =T.DIST.2T(ABS(I6),I2-2)I6 = 8.7493 and I7 = 0.0000228, matching this calculator, R and Python. Format I7 as Scientific to see the small value clearly.
9.3 The awkward cases
Ties. RANK.AVG handles them, and CORREL on the rank columns gives the exact rho. The shortcut formula in I4 will be slightly off, so report I5.
Missing values. RANK.AVG ignores blank cells but CORREL then pairs the wrong rows. Delete the whole row of any incomplete pair before ranking.
Many variables. Rank every column first, then use Data → Data Analysis → Correlation on the rank columns. That gives a full Spearman correlation matrix. The Analysis ToolPak must be switched on first under File → Options → Add-ins → Manage Excel Add-ins → Go.
Confidence interval. Excel has FISHER and FISHERINV. With rho in I5: =FISHERINV(FISHER(I5)-1.96*SQRT((1+I5^2/2)/(I2-3))) gives the lower limit, and the same with a plus sign gives the upper limit: 0.742 and 0.992.
9.4 Why your Excel answer might differ from R or Python
| Situation | What happens | Fix |
|---|---|---|
| Used RANK or RANK.EQ | Tied values get the same top rank, so rho is wrong | Use RANK.AVG |
| Used the shortcut with ties | Excel's I4 differs from SciPy and R in the 2nd or 3rd decimal | Report CORREL on the ranks |
| R gives a different p-value | R's cor.test defaults to exact = TRUE for small n without ties, using algorithm AS 89, not the t approximation | Add exact = FALSE to match Excel and SciPy, or report R's exact value |
| R warns "Cannot compute exact p-value with ties" | R falls back to the t approximation | Not an error; the result then matches Excel |
| SPSS gives a different CI | SPSS offers Fieller, Bonett-Wright or Caruso-Cliff standard errors | Choose Bonett-Wright to match this page |
| Correlation of raw values | CORREL on A and B is Pearson, 0.939, not Spearman | Correlate the rank columns C and D |
| Tool | Spearman rho | p-value |
|---|---|---|
| Excel | =CORREL(RANK cols) | =T.DIST.2T(ABS(t),n-2) |
| Google Sheets | =CORREL(ARRAYFORMULA(RANK.AVG(A2:A11,A2:A11,1)),ARRAYFORMULA(RANK.AVG(B2:B11,B2:B11,1))) | =TDIST(ABS(t),n-2,2) |
| R | cor(x, y, method = "spearman") | cor.test(x, y, method = "spearman") |
| Python SciPy | stats.spearmanr(x, y).statistic | stats.spearmanr(x, y).pvalue |
| Python Pandas | df.corr(method="spearman") | Use SciPy for p |
| SPSS | Analyze → Correlate → Bivariate, tick Spearman, untick Pearson | |
9.5 Charting Spearman correlation in Excel
- Select the two rank columns C2:D11.
- Insert → Charts → Scatter.
- Add axis titles with the + button next to the chart, for example "Rank of maths score".
- Add a 45 degree reference line: a second series with X and Y both equal to 1 and 10, shown as a dashed line. Points on the line are perfect rank agreement.
- For the raw-data view, chart A2:B11 instead. Do not add a linear trendline and call it Spearman; a trendline shows Pearson's straight-line fit.
Chart 2 in Section 3 of this page draws the rank-versus-rank plot with both reference lines for you.
9.6 Excel errors you will probably hit
| Excel shows | Why | Fix |
|---|---|---|
#N/A from RANK.AVG | The value is not inside the range, often a blank or text cell | Check the range and convert text to numbers |
#DIV/0! from CORREL | One column has the same value in every row | Rho is undefined when one variable does not vary |
#NUM! from the t formula | Rho is exactly 1 or −1, so 1 − rho² is 0 | Report p < .001 and the exact permutation p |
| Ranks change when you sort | The range was not locked with $ signs | Use $A$2:$A$11, then fill down |
| Rho is negative when you expected positive | One column ranked ascending and the other descending | Use the same final argument in both RANK.AVG formulas |
| Green triangles in cell corners | Numbers stored as text and skipped | Select, click the warning icon, Convert to Number |
📈 10. How to Run Spearman Rank Correlation in R
In R the coefficient is one line, cor(x, y, method = "spearman"), and the test is cor.test(). The script below is a complete copy-and-run file. It ranks the data, shows Σd², runs the test, builds the Bonett-Wright confidence interval, adds a permutation p-value, prints a plain-English verdict and saves one 300 dpi figure. It uses base R only.
Rscript. Change only the x <- c(...) and y <- c(...) lines to use your own data.10.1 The complete script
R, base only, saves spearman_plot.png
# ============================================================
# Spearman rank correlation with one publication-ready figure
# StatsUnlock - https://statsunlock.com/spearman-rank-correlation-calculator/
# Base R only. No packages to install.
# ============================================================
# ---- 1. Your data ------------------------------------------
# Replace with your own paired values, or read a CSV:
# df <- read.csv("data.csv")
# x <- df$maths; y <- df$physics
x <- c(52, 48, 55, 61, 47, 58, 66, 43, 70, 59)
y <- c(49, 50, 57, 60, 44, 54, 63, 47, 68, 62)
x_label <- "Maths score"
y_label <- "Physics score"
alpha <- 0.05
# drop any pair with a missing value, keeping the rows lined up
ok <- complete.cases(x, y)
x <- x[ok]; y <- y[ok]
n <- length(x)
# ---- 2. Ranks, d and d squared -----------------------------
rx <- rank(x) # ties get the average rank by default
ry <- rank(y)
d <- rx - ry
sum_d2 <- sum(d^2)
rho_short <- 1 - 6 * sum_d2 / (n * (n^2 - 1)) # exact only without ties
# ---- 3. The test -------------------------------------------
# exact = FALSE gives the t approximation, the same as SciPy and SPSS
res <- cor.test(x, y, method = "spearman", exact = FALSE)
rho <- unname(res$estimate)
p <- res$p.value
t_stat <- rho * sqrt((n - 2) / (1 - rho^2))
# Fisher z confidence interval, Bonett-Wright standard error
z <- atanh(rho)
se <- sqrt((1 + rho^2 / 2) / (n - 3))
zc <- qnorm(1 - alpha / 2)
ci <- tanh(z + c(-1, 1) * zc * se)
# Permutation p-value: shuffle y, recompute sum of d squared
set.seed(20261129)
B <- 100000
s_mid <- sum(rx^2) + sum(ry^2) - 2 * sum(rx) * sum(ry) / n
perm <- replicate(B, sum((rx - sample(ry))^2))
p_perm <- (sum(abs(perm - s_mid) >= abs(sum_d2 - s_mid) - 1e-9) + 1) / (B + 1)
# ---- 4. Plain-English verdict ------------------------------
size <- as.character(cut(abs(rho), c(-Inf, .10, .30, .50, .70, Inf), right = FALSE,
labels = c("negligible", "weak", "moderate", "strong", "very strong")))
sign <- if (rho > 0) "positive" else "negative"
cat(sprintf("n = %d, sum d^2 = %g, shortcut rho = %.4f\n", n, sum_d2, rho_short))
cat(sprintf("Spearman rho = %.4f, t(%d) = %.3f, p = %.3g\n", rho, n - 2, t_stat, p))
cat(sprintf("Permutation p = %.5f (%d shuffles)\n", p_perm, B))
cat(sprintf("95%% CI [%.3f, %.3f]\n", ci[1], ci[2]))
if (p < alpha) {
cat(sprintf("Verdict: a significant %s %s monotonic correlation.\n", size, sign))
} else {
cat(sprintf("Verdict: no significant monotonic correlation (rho is %s).\n", size))
}
# ---- 5. One 300 dpi figure ---------------------------------
png("spearman_plot.png", width = 2700, height = 1200, res = 300)
par(mfrow = c(1, 2), mar = c(4.5, 4.5, 3, 1))
plot(x, y, pch = 21, bg = "#16a34a", col = "#14532d", cex = 1.6,
xlab = x_label, ylab = y_label,
main = sprintf("Raw data, rho = %.2f", rho))
plot(rx, ry, pch = 21, bg = "#2563eb", col = "#1e3a8a", cex = 1.6,
xlab = paste("Rank of", x_label), ylab = paste("Rank of", y_label),
main = sprintf("Ranks, sum d^2 = %g", sum_d2))
abline(0, 1, lty = 2, lwd = 2, col = "#16a34a")
dev.off()
cat("Saved spearman_plot.png\n")
Expected output for the sample data: n = 10, sum d^2 = 8, shortcut rho = 0.9515, then Spearman rho = 0.9515, t(8) = 8.749, p = 2.28e-05 and 95% CI [0.742, 0.992]. The permutation p will be close to 0.0001; the exact value is 0.000108.
10.2 What each line does
| Line or function | What it does, and why it is there |
|---|---|
| complete.cases(x, y) | Keeps only rows where both values exist, so the pairs stay matched. |
| rank(x) | Ranks from smallest to largest. The default ties.method = "average" is exactly what Spearman needs. |
| sum(d^2) | The S statistic. R's cor.test prints it as S = 8. |
| cor.test(..., method = "spearman", exact = FALSE) | Runs the test with the t approximation so the p-value matches SciPy, SPSS and Excel. Drop exact = FALSE to get R's AS 89 small-sample p-value instead. |
| atanh(rho), tanh() | The Fisher z transform and its inverse, used for the confidence interval. |
| sqrt((1 + rho^2 / 2) / (n - 3)) | The Bonett-Wright standard error for rank correlations. |
| replicate(B, sum((rx - sample(ry))^2)) | Shuffles the Y ranks 100,000 times to build the null distribution of S. |
| set.seed(20261129) | Makes the permutation p-value the same every time you run it. |
| cut(abs(rho), ...) | Turns rho into a word: negligible, weak, moderate, strong or very strong. |
| png(..., res = 300) | Opens a 300 dpi image file, 9 by 4 inches. |
| abline(0, 1) | Draws the line of perfect rank agreement on the rank plot. |
| dev.off() | Closes the file. Forgetting it leaves an empty PNG. |
10.3 What the figure shows
The left panel plots the raw scores. A steady upward cloud means a positive monotonic link; a curve that never turns back is still fine for Spearman. The right panel plots rank against rank with a dashed line of perfect agreement. The closer the points sit to that line, the smaller every d, and the closer rho is to 1. Points far from the line are the cases that pull rho down.
10.4 Common R problems and fixes
| Symptom | Cause | Fix |
|---|---|---|
| Warning: Cannot compute exact p-value with ties | R's exact method needs untied data | Harmless. Add exact = FALSE to silence it |
cor() returns NA | A missing value in x or y | Use cor(x, y, method = "spearman", use = "complete.obs") |
| p-value differs from SPSS | R used the exact AS 89 method | Set exact = FALSE |
| Error: 'x' and 'y' must have the same length | The vectors are not paired | Check both have n values; use NA for missing ones |
| Rho is 1 but the plot is curved | Nothing wrong: the trend is monotonic | Report rho and describe the curve |
| The PNG is empty | dev.off() was not run | Run it, or while (dev.cur() > 1) dev.off() |
| No confidence interval from cor.test | R only gives a CI for Pearson | Use the Fisher z lines in the script |
| Need a correlation matrix | cor.test takes one pair | cor(df, method = "spearman"), or Hmisc::rcorr(as.matrix(df), type = "spearman") for p-values |
10.5 Useful one-liners
| You want | R code |
|---|---|
| Rho only | cor(x, y, method = "spearman") |
| Rho, S and p | cor.test(x, y, method = "spearman") |
| One-tailed, positive | cor.test(x, y, method = "spearman", alternative = "greater") |
| Matrix for a data frame | cor(df, method = "spearman", use = "pairwise.complete.obs") |
| Kendall tau-b for comparison | cor(x, y, method = "kendall") |
| Holm-adjusted p-values | p.adjust(p_values, method = "holm") |
| Bootstrap CI | boot::boot.ci(boot::boot(cbind(x, y), function(d, i) cor(d[i, 1], d[i, 2], method = "spearman"), 2000), type = "perc") |
📈 11. How to Run Spearman Rank Correlation in Python
In Python, scipy.stats.spearmanr(x, y) returns rho and the p-value in one call. The script below adds everything a report needs: the ranks and Σd², the t statistic, the Bonett-Wright confidence interval, a permutation p-value, a plain-English verdict and one 300 dpi figure.
x = np.array([...]) and y = np.array([...]) lines.rankdata, spearmanr and the normal quantile, matplotlib for the figure. Install with pip install numpy scipy matplotlib. Pandas is optional, only for reading a CSV.11.1 The complete script
Python 3, saves spearman_plot.png
# ============================================================
# Spearman rank correlation with one publication-ready figure
# StatsUnlock - https://statsunlock.com/spearman-rank-correlation-calculator/
# Needs: numpy, scipy, matplotlib (pip install numpy scipy matplotlib)
# ============================================================
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
# ---- 1. Your data ------------------------------------------
# Replace with your own paired values, or read a CSV:
# import pandas as pd
# df = pd.read_csv("data.csv").dropna(subset=["maths", "physics"])
# x, y = df["maths"].to_numpy(), df["physics"].to_numpy()
x = np.array([52, 48, 55, 61, 47, 58, 66, 43, 70, 59], dtype=float)
y = np.array([49, 50, 57, 60, 44, 54, 63, 47, 68, 62], dtype=float)
x_label, y_label = "Maths score", "Physics score"
alpha = 0.05
# drop any pair with a missing value, keeping the rows lined up
keep = ~(np.isnan(x) | np.isnan(y))
x, y = x[keep], y[keep]
n = len(x)
# ---- 2. Ranks, d and d squared -----------------------------
rx = stats.rankdata(x) # average ranks for ties
ry = stats.rankdata(y)
d = rx - ry
sum_d2 = np.sum(d ** 2)
rho_short = 1 - 6 * sum_d2 / (n * (n ** 2 - 1)) # exact only without ties
# ---- 3. The test -------------------------------------------
res = stats.spearmanr(x, y) # two-sided, t approximation
rho, p = res.statistic, res.pvalue
t = rho * np.sqrt((n - 2) / (1 - rho ** 2))
# Fisher z confidence interval, Bonett-Wright standard error
z = np.arctanh(rho)
se = np.sqrt((1 + rho ** 2 / 2) / (n - 3))
zc = stats.norm.ppf(1 - alpha / 2)
ci_lo, ci_hi = np.tanh(z - zc * se), np.tanh(z + zc * se)
# Permutation p-value: shuffle y, recompute sum of d squared
rng = np.random.default_rng(20261129)
B = 100_000
s_mid = np.sum(rx ** 2) + np.sum(ry ** 2) - 2 * rx.sum() * ry.sum() / n
perm = np.array([np.sum((rx - rng.permutation(ry)) ** 2) for _ in range(B)])
p_perm = (np.sum(np.abs(perm - s_mid) >= abs(sum_d2 - s_mid) - 1e-9) + 1) / (B + 1)
# ---- 4. Plain-English verdict ------------------------------
a = abs(rho)
size = ("negligible" if a < .10 else "weak" if a < .30 else
"moderate" if a < .50 else "strong" if a < .70 else "very strong")
sign = "positive" if rho > 0 else "negative"
print(f"n = {n}, sum d^2 = {sum_d2:g}, shortcut rho = {rho_short:.4f}")
print(f"Spearman rho = {rho:.4f}, t({n-2}) = {t:.3f}, p = {p:.3g}")
print(f"Permutation p = {p_perm:.5f} ({B:,} shuffles)")
print(f"95% CI [{ci_lo:.3f}, {ci_hi:.3f}]")
if p < alpha:
print(f"Verdict: a significant {size} {sign} monotonic correlation.")
else:
print(f"Verdict: no significant monotonic correlation (rho is {size}).")
# ---- 5. One 300 dpi figure ---------------------------------
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(9, 4))
ax1.scatter(x, y, s=60, color="#16a34a", edgecolor="#14532d")
ax1.set_xlabel(x_label); ax1.set_ylabel(y_label)
ax1.set_title(f"Raw data, rho = {rho:.2f}")
ax2.scatter(rx, ry, s=60, color="#2563eb", edgecolor="#1e3a8a")
ax2.plot([1, n], [1, n], "--", color="#16a34a", label="perfect agreement")
ax2.set_xlabel(f"Rank of {x_label}"); ax2.set_ylabel(f"Rank of {y_label}")
ax2.set_title(f"Ranks, sum d$^2$ = {sum_d2:g}")
ax2.legend(loc="upper left", frameon=False)
fig.tight_layout()
fig.savefig("spearman_plot.png", dpi=300)
print("Saved spearman_plot.png")
Tested output: n = 10, sum d^2 = 8, shortcut rho = 0.9515, Spearman rho = 0.9515, t(8) = 8.749, p = 2.28e-05, Permutation p = 0.00010 (100,000 shuffles), 95% CI [0.742, 0.992].
11.2 What each line does
| Line or function | What it does, and why it is there |
|---|---|
| np.isnan(x) | np.isnan(y) | Finds incomplete pairs so they can be dropped together. |
| stats.rankdata(x) | Average ranks, smallest = 1, ties shared. The same rule as R and Excel's RANK.AVG. |
| stats.spearmanr(x, y) | Exact tie-corrected rho with a two-sided t-approximation p-value. Add alternative="greater" for a one-tailed test. |
| np.arctanh, np.tanh | The Fisher z transform and its inverse for the confidence interval. |
| stats.norm.ppf(1 - alpha / 2) | 1.960 for a 95% interval. |
| np.random.default_rng(20261129) | A seeded generator, so the permutation p-value is reproducible. |
| rng.permutation(ry) | Shuffles the Y ranks to break the pairing and simulate H0. |
| fig.savefig(..., dpi=300) | Saves one print-quality figure. |
11.3 What the figure shows
The same two panels as the R figure: raw scores on the left and ranks on the right, with the dashed 45 degree line of perfect agreement. Both scripts make the same picture from the same numbers, so you can use whichever language your team prefers.
11.4 Common Python problems and fixes
| Symptom | Cause | Fix |
|---|---|---|
spearmanr returns nan | A NaN in the data, or a constant column | Drop NaN pairs first, or pass nan_policy="omit" |
| AttributeError: no attribute 'statistic' | SciPy older than 1.9 returns .correlation | Upgrade SciPy, or use res.correlation |
| ConstantInputWarning | One variable never changes | Rho is undefined; check the data |
| Given a 2-D array, you get a matrix | spearmanr treats columns as variables | That is the Spearman correlation matrix; read res.statistic[0, 1] |
| p differs from R | R used exact AS 89 | Use exact = FALSE in R, or stats.permutation_test in Python |
Pandas corr has no p-values | It only computes coefficients | Loop over pairs with spearmanr, or use pingouin.pairwise_corr |
11.5 Useful one-liners
| You want | Python code |
|---|---|
| Rho and p | stats.spearmanr(x, y) |
| One-tailed, negative | stats.spearmanr(x, y, alternative="less") |
| Matrix for a DataFrame | df.corr(method="spearman") |
| Kendall tau-b | stats.kendalltau(x, y) |
| Holm correction | from statsmodels.stats.multitest import multipletests; multipletests(p, method="holm") |
| Bootstrap CI | stats.bootstrap((x, y), lambda a, b: stats.spearmanr(a, b).statistic, paired=True, vectorized=False) |
📋 12. Reference Tables
12.1 Critical values of Spearman's rs, two-tailed
Reject H0 when |rs| is at least the value in the table. Values for n = 5 to 12 were computed for this page by checking every possible ordering (up to 479,001,600 for n = 12). Values for n = 13 to 30 are from Zar (1972) and agree with 2 million random permutations per n to within 0.003. The last column shows the t-approximation value at α = .05 for comparison. For a one-tailed test, use the column for twice your alpha.
| n | α = .10 | α = .05 | α = .02 | α = .01 | t approx., .05 |
|---|---|---|---|---|---|
| 5 | 0.900 | 1.000 | 1.000 | none | 0.878 |
| 6 | 0.829 | 0.886 | 0.943 | 1.000 | 0.811 |
| 7 | 0.714 | 0.786 | 0.893 | 0.929 | 0.754 |
| 8 | 0.643 | 0.738 | 0.833 | 0.881 | 0.707 |
| 9 | 0.600 | 0.700 | 0.783 | 0.833 | 0.666 |
| 10 | 0.564 | 0.648 | 0.745 | 0.794 | 0.632 |
| 11 | 0.536 | 0.618 | 0.709 | 0.755 | 0.602 |
| 12 | 0.503 | 0.587 | 0.678 | 0.727 | 0.576 |
| 13 | 0.484 | 0.560 | 0.648 | 0.703 | 0.553 |
| 14 | 0.464 | 0.538 | 0.626 | 0.679 | 0.532 |
| 15 | 0.446 | 0.521 | 0.604 | 0.654 | 0.514 |
| 16 | 0.429 | 0.503 | 0.582 | 0.635 | 0.497 |
| 17 | 0.414 | 0.485 | 0.566 | 0.615 | 0.482 |
| 18 | 0.401 | 0.472 | 0.550 | 0.600 | 0.468 |
| 19 | 0.391 | 0.460 | 0.535 | 0.584 | 0.456 |
| 20 | 0.380 | 0.447 | 0.520 | 0.570 | 0.444 |
| 21 | 0.370 | 0.435 | 0.508 | 0.556 | 0.433 |
| 22 | 0.361 | 0.425 | 0.496 | 0.544 | 0.423 |
| 23 | 0.353 | 0.415 | 0.486 | 0.532 | 0.413 |
| 24 | 0.344 | 0.406 | 0.476 | 0.521 | 0.404 |
| 25 | 0.337 | 0.398 | 0.466 | 0.511 | 0.396 |
| 26 | 0.331 | 0.390 | 0.457 | 0.501 | 0.388 |
| 27 | 0.324 | 0.382 | 0.448 | 0.491 | 0.381 |
| 28 | 0.317 | 0.375 | 0.440 | 0.483 | 0.374 |
| 29 | 0.312 | 0.368 | 0.433 | 0.475 | 0.367 |
| 30 | 0.306 | 0.362 | 0.425 | 0.467 | 0.361 |
What to conclude: for n = 10 at α = .05 you need |rs| ≥ 0.648. The worked example, 0.952, passes easily. At n = 11, a rho of 0.609 passes the t approximation (0.602) but fails the exact value (0.618), which is why small samples need the exact table. "none" means no rho can reach that level with so few pairs.
12.2 How strong is the correlation?
| |rs| | This calculator | Cohen (1988, 1992) | Schober et al. (2018) | rs² shared |
|---|---|---|---|---|
| 0.00 to 0.09 | Negligible | Trivial | Negligible | below 1% |
| 0.10 to 0.29 | Weak | Small (0.10) | Weak (0.10 to 0.39) | 1% to 8% |
| 0.30 to 0.49 | Moderate | Medium (0.30) | Weak to moderate | 9% to 24% |
| 0.50 to 0.69 | Strong | Large (0.50) | Moderate (0.40 to 0.69) | 25% to 48% |
| 0.70 to 0.89 | Very strong | Large | Strong (0.70 to 0.89) | 49% to 79% |
| 0.90 to 1.00 | Very strong | Large | Very strong (0.90 to 1.00) | 81% to 100% |
What to conclude: name the scheme you used. The same rho of 0.45 is "moderate" here and in Cohen's terms, but "weak" under Schober and colleagues.
12.3 Sample size needed (pairs) to detect a true rho
| True rho | 80% power, α = .05 | 90% power, α = .05 | 80% power, α = .01 |
|---|---|---|---|
| 0.1 | 787 | 1052 | 1169 |
| 0.2 | 198 | 264 | 293 |
| 0.3 | 89 | 118 | 131 |
| 0.4 | 51 | 67 | 74 |
| 0.5 | 33 | 43 | 47 |
| 0.6 | 23 | 29 | 32 |
| 0.7 | 16 | 21 | 23 |
| 0.8 | 12 | 15 | 16 |
| 0.9 | 9 | 10 | 11 |
What to conclude: two-tailed, Fisher z method with the Bonett-Wright (2000) adjustment. Small effects need hundreds of pairs; a study of 20 pairs can only reliably detect rho of about 0.6 or more.
12.4 How precise is rho? 95% CI for an observed rho of 0.50
| n | Lower | Upper | Reading |
|---|---|---|---|
| 10 | −0.232 | 0.870 | Includes zero: not significant |
| 20 | 0.045 | 0.783 | Weak to very strong |
| 30 | 0.148 | 0.740 | Weak to very strong |
| 50 | 0.241 | 0.692 | Weak to strong |
| 100 | 0.326 | 0.641 | Moderate to strong |
| 200 | 0.381 | 0.603 | Moderate to strong |
What to conclude: below about 30 pairs, even a "strong" rho comes with a very wide interval. Report the interval, not just the point value.
12.5 How to assign ranks with ties
| Sorted value | 12 | 15 | 15 | 18 | 20 | 20 | 20 | 25 |
|---|---|---|---|---|---|---|---|---|
| Position | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| Average rank | 1 | 2.5 | 2.5 | 4 | 6 | 6 | 6 | 8 |
What to conclude: the two 15s share positions 2 and 3, so each gets 2.5; the three 20s share 5, 6 and 7, so each gets 6. The ranks still add up to n(n + 1)/2 = 36, which is a quick check that you ranked correctly. This is Excel's RANK.AVG, R's rank() and SciPy's rankdata().
12.6 Spearman, Pearson or Kendall?
| Situation | Best choice | Why |
|---|---|---|
| Normal, linear, no outliers | Pearson | Most power when its assumptions hold |
| Skewed or with outliers | Spearman | Ranks limit the pull of extreme values |
| Curved but monotonic | Spearman | Rho stays high for any steady trend |
| Ranks or Likert items | Spearman or Kendall | Both are designed for ordered data |
| n under 10 with many ties | Kendall tau-b | Better small-sample behaviour with ties |
| U-shape or inverted U | None of these | Use polynomial regression or distance correlation |
What to conclude: Spearman is the safe default when you are unsure. The results table reports Pearson and Kendall too, so you can see whether the choice matters for your data.
📈 13. Example Results
Eight worked Spearman rank correlation examples, each run through this calculator. They cover a textbook case, a clear negative result, a borderline call, a null result, a small sample, a large sample with a trivial effect, a broken assumption, and heavily tied Likert data. Seven of them are built-in sample datasets, so you can load them in Section 2 and check every number.
Maths and physics exam scores
The clean case: no ties, and every formula agrees.
Ten students sat a maths and a physics exam. Do students who do well in one also do well in the other?
| Statistic | Value | Note |
|---|---|---|
| n (pairs) | 10 | Complete pairs |
| Σd² | 8 | Sum of squared rank differences |
| Spearman rs (exact) | 0.9515 | Pearson r on the average ranks |
| Shortcut 1 − 6Σd²/[n(n²−1)] | 0.9515 | Same, no ties |
| t (df) | 8.749 (8) | t = rs√[(n−2)/(1−rs²)] |
| p, t approximation | 2.28e-05 | Two-tailed |
| p, exact | 0.000108 | All orderings |
| 95% CI (Fisher z) | [0.742, 0.992] | Bonett-Wright SE |
| Critical rs, .05 (t-based) | 0.632 | Reject if |rs| is at least this |
| Kendall tau-b | 0.822 | Second rank coefficient |
What it means: Maths and physics ranks agree almost perfectly. Only small swaps of one place separate the two orders, so Σd² is just 8 and rho is 0.95. The exact p, .000108, and the t p, .0000228, both show this is far beyond chance.
How to write it: "rs(8) = .95, p < .001, 95% CI [.74, .99]."
Sleep hours and reaction time
A very strong negative link.
Twelve adults recorded their sleep and then did a reaction-time test. More sleep should mean faster, so lower, reaction times.
| Statistic | Value | Note |
|---|---|---|
| n (pairs) | 12 | Complete pairs |
| Σd² | 568 | Sum of squared rank differences |
| Spearman rs (exact) | -0.9860 | Pearson r on the average ranks |
| Shortcut 1 − 6Σd²/[n(n²−1)] | -0.9860 | Same, no ties |
| t (df) | -18.709 (10) | t = rs√[(n−2)/(1−rs²)] |
| p, t approximation | 4.12e-09 | Two-tailed |
| p, permutation | 1.00e-04 | 10,000 shuffles |
| 95% CI (Fisher z) | [−0.997, −0.933] | Bonett-Wright SE |
| Critical rs, .05 (t-based) | 0.576 | Reject if |rs| is at least this |
| Kendall tau-b | -0.939 | Second rank coefficient |
What it means: Rho is −0.99: the more someone slept, the lower their reaction time rank, with almost no exceptions. A negative rho is just as strong as a positive one; it only means the variables move in opposite directions.
How to write it: "Sleep duration was strongly negatively correlated with reaction time, rs(10) = −.99, p < .001."
Advertising spend and sales, with one outlier
Where the t test and the exact test disagree.
Eleven shops. One spent $60k on advertising but sold little. Pearson's r is −0.12, almost nothing. What does Spearman say?
| Statistic | Value | Note |
|---|---|---|
| n (pairs) | 11 | Complete pairs |
| Σd² | 86 | Sum of squared rank differences |
| Spearman rs (exact) | 0.6091 | Pearson r on the average ranks |
| Shortcut 1 − 6Σd²/[n(n²−1)] | 0.6091 | Same, no ties |
| t (df) | 2.304 (9) | t = rs√[(n−2)/(1−rs²)] |
| p, t approximation | 0.0467 | Two-tailed |
| p, permutation | 0.0513 | 10,000 shuffles |
| 95% CI (Fisher z) | [−0.047, 0.898] | Bonett-Wright SE |
| Critical rs, .05 (t-based) | 0.602 | Reject if |rs| is at least this |
| Kendall tau-b | 0.564 | Second rank coefficient |
What it means: Rho is 0.61. The t approximation gives p = .047, just below .05, but the permutation p is .051 and the exact critical value for n = 11 is 0.618, so the exact test does not reject H0. The interval also crosses zero. This is borderline evidence; report both p-values and avoid a firm claim. Notice how far Pearson's r falls because of one shop, while Spearman barely moves.
How to write it: "rs(9) = .61, p = .047 (t approximation), permutation p = .051, 95% CI [−.05, .90]; the result should be treated as inconclusive."
Household income and life satisfaction
A weak link that could be chance.
Twenty households reported income and life satisfaction on a 1 to 10 scale.
| Statistic | Value | Note |
|---|---|---|
| n (pairs) | 20 | Complete pairs |
| Σd² | 851 | Sum of squared rank differences |
| Spearman rs (exact) | 0.3380 | Pearson r on the average ranks |
| Shortcut 1 − 6Σd²/[n(n²−1)] | 0.3602 | Differs only when ties exist |
| t (df) | 1.523 (18) | t = rs√[(n−2)/(1−rs²)] |
| p, t approximation | 0.1450 | Two-tailed |
| p, permutation | 0.1404 | 10,000 shuffles |
| 95% CI (Fisher z) | [−0.136, 0.686] | Bonett-Wright SE |
| Critical rs, .05 (t-based) | 0.444 | Reject if |rs| is at least this |
| Kendall tau-b | 0.249 | Second rank coefficient |
What it means: Rho is 0.34, a moderate-looking value, but p = .145 and the interval runs from −0.14 to 0.69. With only 20 pairs the data are compatible with no link at all, or with a strong one. The right conclusion is "not enough evidence", not "no relationship". Note the ties in satisfaction scores: the shortcut formula gives 0.360, the exact value is 0.338.
How to write it: "There was no statistically significant correlation between income and life satisfaction, rs(18) = .34, p = .145, 95% CI [−.14, .69]."
Training hours and VO2 max
Seven athletes: use the exact p-value.
Seven endurance athletes. Does more weekly training go with a higher VO2 max?
| Statistic | Value | Note |
|---|---|---|
| n (pairs) | 7 | Complete pairs |
| Σd² | 4 | Sum of squared rank differences |
| Spearman rs (exact) | 0.9286 | Pearson r on the average ranks |
| Shortcut 1 − 6Σd²/[n(n²−1)] | 0.9286 | Same, no ties |
| t (df) | 5.594 (5) | t = rs√[(n−2)/(1−rs²)] |
| p, t approximation | 0.0025 | Two-tailed |
| p, exact | 0.0067 | All orderings |
| 95% CI (Fisher z) | [0.443, 0.993] | Bonett-Wright SE |
| Critical rs, .05 (t-based) | 0.754 | Reject if |rs| is at least this |
| Kendall tau-b | 0.810 | Second rank coefficient |
What it means: Rho is 0.93. With n = 7, the exact critical value is 0.786, so the result is significant. The exact permutation p-value, .0067, checked all 5,040 orderings; the t approximation gives .0025, which is too optimistic at this size. The interval, 0.44 to 0.99, is wide, as it always is with 7 pairs.
How to write it: "rs(5) = .93, exact p = .007, 95% CI [.44, .99]."
Screen time and sleep quality, 500 people
A large sample makes a tiny rho significant.
An online survey of 500 adults recorded evening screen time and a sleep quality score. (Simulated data, seed 42.)
| Statistic | Value | Note |
|---|---|---|
| n (pairs) | 500 | Complete pairs |
| Σd² | 1.8682e+07 | Sum of squared rank differences |
| Spearman rs (exact) | 0.1032 | Pearson r on the average ranks |
| Shortcut 1 − 6Σd²/[n(n²−1)] | 0.1033 | Differs only when ties exist |
| t (df) | 2.316 (498) | t = rs√[(n−2)/(1−rs²)] |
| p, t approximation | 0.0210 | Two-tailed |
| p, permutation | 0.0230 | 10,000 shuffles |
| 95% CI (Fisher z) | [0.015, 0.189] | Bonett-Wright SE |
| Critical rs, .05 (t-based) | 0.088 | Reject if |rs| is at least this |
| Kendall tau-b | 0.070 | Second rank coefficient |
What it means: Rho is only 0.10, so the ranks share about 1% of their variance, yet p = .021 because n is large. The result is statistically significant but practically trivial: knowing someone's screen time tells you almost nothing about their sleep. Always report the size of rho, not only the p-value.
How to write it: "Screen time showed a statistically significant but negligible correlation with sleep quality, rs(498) = .10, p = .021, 95% CI [.02, .19]."
Anxiety and performance, an inverted U
Rho near zero hides a strong relationship.
Thirteen students rated their test anxiety and took a performance test. Performance rises with mild anxiety and falls at high anxiety.
| Statistic | Value | Note |
|---|---|---|
| n (pairs) | 13 | Complete pairs |
| Σd² | 406 | Sum of squared rank differences |
| Spearman rs (exact) | -0.1154 | Pearson r on the average ranks |
| Shortcut 1 − 6Σd²/[n(n²−1)] | -0.1154 | Same, no ties |
| t (df) | -0.385 (11) | t = rs√[(n−2)/(1−rs²)] |
| p, t approximation | 0.7074 | Two-tailed |
| p, permutation | 0.7084 | 10,000 shuffles |
| 95% CI (Fisher z) | [−0.628, 0.467] | Bonett-Wright SE |
| Critical rs, .05 (t-based) | 0.553 | Reject if |rs| is at least this |
| Kendall tau-b | -0.077 | Second rank coefficient |
What it means: Rho is −0.12 and p = .71, which looks like no relationship. But the scatter plot shows a clear inverted U. Spearman measures only monotonic trends, so rises and falls cancel out. The half-split check flags this: rho is strongly positive in the lower half of anxiety and strongly negative in the upper half. Fit a quadratic regression instead.
How to write it: "Spearman's rho was not used because the relationship was non-monotonic (inverted U); a quadratic regression model was fitted instead."
Customer satisfaction and repurchase intent (1 to 7)
Likert data with many tied ranks.
Fifteen customers rated satisfaction and how likely they were to buy again, both on 1 to 7 scales.
| Statistic | Value | Note |
|---|---|---|
| n (pairs) | 15 | Complete pairs |
| Σd² | 62 | Sum of squared rank differences |
| Spearman rs (exact) | 0.8858 | Pearson r on the average ranks |
| Shortcut 1 − 6Σd²/[n(n²−1)] | 0.8893 | Differs only when ties exist |
| t (df) | 6.883 (13) | t = rs√[(n−2)/(1−rs²)] |
| p, t approximation | 1.11e-05 | Two-tailed |
| p, permutation | 1.00e-04 | 10,000 shuffles |
| 95% CI (Fisher z) | [0.626, 0.969] | Bonett-Wright SE |
| Critical rs, .05 (t-based) | 0.514 | Reject if |rs| is at least this |
| Kendall tau-b | 0.772 | Second rank coefficient |
What it means: Both variables have five groups of tied values. The exact tie-corrected rho is 0.886; the shortcut formula would give 0.889, slightly too high. Either way the link is very strong and significant. Kendall's tau-b, 0.77, tells the same story and is a good second figure for heavily tied data.
How to write it: "Satisfaction was strongly positively correlated with repurchase intent, rs(13) = .89, p < .001, 95% CI [.63, .97]."
🧪 14. Data Collection Protocol
Study design: Spearman's rank correlation needs one sample of independent cases, with two measurements on each case. The measurements must be at least ordinal, meaning they can be put in order.
- Write the question as a monotonic one. "Do students who rank higher in maths also rank higher in physics?" is right for Spearman. "Does performance peak at medium anxiety?" is not, because the expected shape turns back.
- Define the case. One student, one plot, one patient. Each case gives exactly one X and one Y. Repeated readings of the same case break independence; average them first.
- Choose the direction of the test before collecting data. Use a one-tailed test only if a result in the other direction would be meaningless for your question.
- Plan the sample size. Use Table 12.3. To detect a moderate rho of 0.30 with 80% power at α = .05 you need about 89 pairs; for a strong rho of 0.50, about 33. Never go below 5 pairs.
- Sample at random or systematically. A restricted range (only top students) shrinks rho, because the ranks are squeezed together.
- Fix the scales. Use the same Likert anchors, instrument and units for every case, and record them.
- Record both variables on the same row with a case ID. This is the step that most often goes wrong when data from two sources are merged.
- Code missing values as blank or NA, never as 0. A fake 0 becomes the lowest rank and can create a false correlation.
- Keep the raw values, not only the ranks. You will need them for the scatter plot and for any later Pearson comparison.
- Decide the outlier and tie rules in advance. Spearman keeps outliers by design and uses average ranks for ties; say so in your protocol.
- Plot before you test. A quick scatter plot catches U-shapes, clusters and data-entry errors before they reach the results.
| case_id | maths_score | physics_score | notes |
|---|---|---|---|
| S01 | 52 | 49 | Both exams same week |
| S02 | 48 | 50 | |
| S03 | 55 | NA | Absent for physics; pair dropped |
Minimum sample: 5 pairs to compute a test at all, 10 or more for the t approximation, and 30 or more for a confidence interval narrow enough to be useful. Pre-registration line: "We will test H1: ρs > 0 between X and Y using Spearman's rank correlation (average ranks for ties), one-tailed, α = .05, n = 89."
🎯 15. When to Use This Spearman Rank Correlation Calculator
This free Spearman rank correlation calculator is designed for anyone who needs to test whether two variables move together in a steady direction without assuming a straight line or a normal distribution.
- One or both variables are ordinal, such as Likert scores, grades or rankings.
- The data are skewed, such as income, counts or reaction times.
- There are outliers you cannot remove.
- The trend is curved but always rising or always falling.
- You want to know if two judges or methods rank cases the same way.
- The relationship turns back (U-shape or inverted U).
- The data are not paired, for example two separate groups.
- One variable is a category with no order, such as eye colour.
- You want to predict Y from X; use regression.
- You need to test agreement on the same scale; use the ICC or Bland-Altman.
15.1 Four quick examples
- Education: do class rank in year 10 and class rank in year 12 agree? Yes, Spearman.
- Ecology: does bird species count rise with tree diameter across 12 plots? Yes, counts are skewed and the trend may flatten.
- Medicine: does pain relief increase with dose when the curve levels off? Yes, rho captures the steady rise.
- Psychology: does performance rise then fall with anxiety? No. Fit a curve instead.
15.2 Design guidance
Spearman is the default when you are unsure whether Pearson's assumptions hold. With normal data it is still about 91% as efficient as Pearson in large samples, so the cost of choosing it is small. With skewed data or outliers it can be far more accurate than Pearson.
15.3 Decision tree: which correlation test?
| If your data are | Use |
|---|---|
| Two continuous variables, linear, roughly normal, no outliers | Pearson correlation |
| Ordinal, skewed, outliers, or curved but monotonic | Spearman rank correlation (this tool) |
| Small n with many ties, or you want a probability interpretation | Kendall's tau-b |
| One variable binary, one continuous | Point-biserial correlation |
| Both variables categorical | Chi-square test with Cramér's V |
| Agreement between two raters on the same scale | ICC or weighted kappa |
| Controlling for a third variable | Partial Spearman correlation |
🔧 16. Troubleshooting and Common Errors
"The variables have different numbers of values"
Cause: one column is shorter, usually a missing value that was deleted instead of marked. Fix: type NA in the empty position so every row stays lined up, then press Run again.
"Not a number" next to a variable
Cause: units, % signs, currency or thousands separators such as 1,200. Fix: remove them. Use a full stop for decimals; a comma is read as a separator.
My rho differs from my textbook answer
Cause: the data contain ties and the textbook used the shortcut 1 − 6Σd² formula. Fix: compare with the "Shortcut" row in the results table, which shows the textbook value next to the exact one.
The p-value is different from R
Cause: R's cor.test uses the exact AS 89 method by default for small untied samples. Fix: use exact = FALSE in R to match this page's t approximation, or compare R with this page's exact permutation p-value.
Rho is close to 0 but the scatter plot clearly shows a pattern
Cause: the relationship is not monotonic; it rises then falls. Fix: do not report "no relationship". Describe the curve and use a quadratic or polynomial regression.
Rho is exactly 1 and no confidence interval appears
Cause: the ranks agree perfectly, so the Fisher z transform is infinite. Fix: this is correct. Check the two columns are not copies of each other, then report rho = 1 with the exact p-value.
"rho cannot be calculated" message
Cause: one variable has the same value for every case. Fix: a variable that never changes has no ranking. Check you selected the right column.
The t and permutation p-values disagree about significance
Cause: a small sample and a rho right at the edge. Fix: report the permutation p-value for n under 20, report both, and avoid a firm yes or no claim.
Uploaded file shows no columns to pick
Cause: no header row, or numbers stored as text. Fix: put variable names in row 1 and numbers below. Only columns with at least 3 numbers are offered.
Charts are missing
Cause: the chart library was blocked by a browser extension or a slow connection. Fix: reload the page. Every number and sentence still works without the charts.
Many pairs in the matrix are significant before correction but not after
Cause: testing many pairs inflates false positives, so the Holm correction raises each p-value. Fix: report the Holm-adjusted values, or pre-register the one pair you care about most.
⚖ 17. Assumptions and Limitations
17.1 Assumptions
- Paired data. Each X belongs to the same case as its Y. Check: a case ID column. If it fails: rho is meaningless and can go in any direction.
- Independent cases. No case is counted twice and cases do not influence each other. Check: the study design. If it fails: the p-value is too small, so false positives become more likely.
- At least ordinal data. Values can be put in order. Check: the scale type. If it fails: with unordered categories rho has no meaning; use Cramér's V.
- A monotonic relationship. Check: Chart 1 and the half-split check in the assumption table. If it fails: rho is biased toward zero and underestimates the real link.
- Enough pairs. Check: n ≥ 10 for the t approximation. If it fails: the t p-value can be too small or too large; the exact permutation p fixes it.
Spearman does not assume normality, equal spacing, linearity or the absence of outliers.
17.2 Limitations
- Only monotonic trends. Curves that turn back need polynomial regression or a distance correlation.
- Ranks throw away distance. A gap of 1 point and a gap of 100 points count the same. If spacing matters and the data are normal, Pearson is more powerful.
- No causation. For causal questions use an experiment or a causal model.
- No control for other variables. Use partial Spearman correlation or rank-based regression.
- Heavy ties reduce information. With only 3 or 4 distinct values, Kendall's tau-b or a polychoric correlation may fit better.
- Restricted range shrinks rho. Sample the full range, or report the range alongside rho.
🏁 18. Conclusion
The Spearman rank correlation calculator turns two columns of numbers into ranks and asks one clear question: do the cases come in the same order on both variables? The answer, rho, runs from −1 to +1, works for ordinal, skewed and outlier-heavy data, and stays at 1 for any curve that never changes direction.
A good Spearman analysis has four parts. First, the coefficient and its size in words. Second, a p-value that suits the sample size: the t approximation from about 10 pairs, the exact permutation value below that. Third, a confidence interval, because a significant rho of 0.30 from 50 pairs could really be anything from weak to strong. Fourth, a scatter plot, because a rho near zero can hide a clear U-shape.
Keep the limits in mind. Rho shows association, not cause. It ignores the distance between values, so with clean normal data Pearson's r carries a little more power. Ties make the shortcut formula approximate, which is why this tool always reports the exact tie-corrected value. With three or more variables, correct for the number of tests.
Use the five templates in Section 5 to write up the result, the Excel, R and Python sections to reproduce it in your own software, and the critical-value table in Section 12 to check small samples by hand. Used this way, the Spearman rank correlation calculator gives you a result that is correct, clearly explained and ready for a thesis, a paper or a class report.
❓ 19. Frequently Asked Questions
Q1. What is Spearman's rank correlation coefficient?
Spearman's rank correlation coefficient, rs or rho, measures how strongly two variables are related in a monotonic way, meaning one tends to rise or fall steadily as the other rises. It is Pearson's correlation applied to the ranks of the data, so it runs from −1 to +1 and does not need normal data.
Q2. What is the formula for Spearman's rank correlation?
Without ties, rs = 1 − 6Σd² ÷ [n(n² − 1)], where d is the difference between the two ranks of each case and n is the number of pairs. With ties, the exact value is Pearson's r calculated on the average ranks.
Q3. How do you calculate Spearman's rank correlation step by step?
Rank each variable from smallest to largest, giving tied values the average rank. Subtract the Y rank from the X rank for each pair to get d, square each d, and add them up. Put Σd² and n into 1 − 6Σd² ÷ [n(n² − 1)]. For 10 pairs with Σd² = 8, rho = 1 − 48 ÷ 990 = 0.95.
Q4. How do you interpret Spearman's rho?
The sign gives the direction and the size gives the strength. A common guide is: below 0.10 negligible, 0.10 to 0.29 weak, 0.30 to 0.49 moderate, 0.50 to 0.69 strong, and 0.70 or above very strong. Always read it with the p-value, the confidence interval and a scatter plot.
Q5. When should I use Spearman instead of Pearson correlation?
Use Spearman when the data are ordinal (ranks, Likert scales), skewed, contain outliers, or follow a curve that never changes direction. Use Pearson when both variables are continuous, roughly normal and linearly related.
Q6. Can Spearman's rank correlation be negative?
Yes. A negative rho means that as one variable's rank goes up, the other's goes down. For example, more hours of sleep go with lower reaction times, giving rho = −0.99 in sample dataset 2. The minimum possible value is −1.
Q7. How do you handle tied ranks in Spearman correlation?
Give each tied value the average of the ranks it would occupy. Two values in 3rd and 4th place both get 3.5; three values in 5th to 7th place all get 6. Then calculate Pearson's r on the ranks. The shortcut 1 − 6Σd² formula is only approximate when ties exist.
Q8. What is the null hypothesis for the Spearman rank correlation test?
H0: the population Spearman correlation is 0, meaning there is no monotonic association. The two-tailed alternative is that it is not 0. One-tailed alternatives say it is above 0 or below 0.
Q9. How do you find the p-value for Spearman's rho?
For n of about 10 or more, compute t = rs√[(n − 2) ÷ (1 − rs²)] and compare it with Student's t on n − 2 degrees of freedom. For smaller samples, use an exact permutation p-value, which this calculator works out by checking every possible ordering.
Q10. What are the critical values for Spearman's rank correlation?
For a two-tailed test at α = .05, the exact critical values are 1.000 for n = 5, 0.886 for n = 6, 0.786 for n = 7, 0.738 for n = 8, 0.700 for n = 9, 0.648 for n = 10, 0.447 for n = 20 and 0.362 for n = 30. Reject H0 if |rs| is at least the critical value. The full table is in Section 12.
Q11. How many degrees of freedom does Spearman's correlation have?
The t test for Spearman's rho uses n − 2 degrees of freedom, where n is the number of complete pairs. Ten pairs give 8 degrees of freedom, which is why APA reports write rs(8) = .95.
Q12. What is the minimum sample size for Spearman correlation?
The coefficient can be calculated from 3 pairs, but a significance test needs at least 5, and with 5 pairs only a perfect rho of 1 is significant at .05. Aim for 10 or more for the t approximation and use Table 12.3 to plan for 80% power.
Q13. How do you report Spearman correlation in APA style?
Write the symbol in italics with degrees of freedom, the value without a leading zero, the exact p-value and the confidence interval, for example: rs(8) = .95, p < .001, 95% CI [.74, .99]. Section 5 auto-fills this sentence from your data.
Q14. How do you calculate Spearman's rank correlation in Excel?
Excel has no SPEARMAN function. Rank both columns with =RANK.AVG(A2,$A$2:$A$11,1), then use =CORREL on the two rank columns. That gives the exact tie-corrected rho. Get the p-value with =T.DIST.2T(ABS(t), n-2). Section 9 shows every step with screenshots.
Q15. How do you run Spearman correlation in R?
Use cor.test(x, y, method = "spearman"). It prints S (the sum of d²), the p-value and rho. Add exact = FALSE to get the t approximation used by SPSS and SciPy. For a whole data frame use cor(df, method = "spearman").
Q16. How do you calculate Spearman correlation in Python?
Use from scipy import stats, then stats.spearmanr(x, y). The result has .statistic for rho and .pvalue for the two-sided p-value. For a pandas DataFrame, df.corr(method="spearman") gives the full correlation matrix.
Q17. What is the difference between Spearman and Kendall rank correlation?
Both use ranks. Spearman's rho is Pearson's r on the ranks; Kendall's tau-b is the share of concordant minus discordant pairs. Tau is usually about two-thirds the size of rho, handles many ties well, and has a direct probability meaning. They nearly always agree on significance.
Q18. Does Spearman's correlation assume normality or linearity?
No. Spearman needs paired, independent cases measured on at least an ordinal scale, and a monotonic relationship. It does not assume normal data, a straight line, equal spacing or the absence of outliers.
Q19. Can I use Spearman correlation for Likert scale data?
Yes. Likert items are ordinal, which is exactly what Spearman is designed for. Expect many tied ranks; this calculator handles them with average ranks and gives the exact tie-corrected rho, which matches SPSS and R.
Q20. Can I use this Spearman calculator for my thesis or published research?
Yes. It uses the same exact tie-corrected rho and t-approximation p-value as SPSS, R and SciPy, adds an exact permutation test and confidence intervals, and gives copy-ready APA, thesis and Methods wording. Cite it with the reference in Section 20.
📑 20. Cite This Tool
StatsUnlock. (2026). Spearman rank correlation calculator [Interactive statistical tool]. https://statsunlock.com/spearman-rank-correlation-calculator/@misc{statsunlock_spearman_2026, title={Spearman Rank Correlation Calculator}, author={{StatsUnlock}}, year={2026}, note={Interactive statistical tool}, url={https://statsunlock.com/spearman-rank-correlation-calculator/}}🔗 21. Related Tools
Check normality first to decide between Pearson and Spearman.
Compare two separate groups instead of two paired variables.
Test whether paired measurements differ, not whether they move together.
90%, 95% and 99% intervals for means and proportions, with steps.
Predict Y from several X variables once a relationship is found.
Regression when the spread of Y changes across X.
Spot skew and outliers that point you toward Spearman.
Plan survey sample sizes before you collect Likert data.
📖 22. Glossary of Terms
- Alpha (α)
- The cut-off for calling a result significant, usually 0.05.
- Average rank
- The rank given to tied values: the mean of the positions they share.
- Bootstrap
- Resampling the pairs with replacement many times to see how much rho varies.
- Concordant pair
- Two cases ordered the same way on both variables.
- Confidence interval (CI)
- A range of plausible values for the population rho.
- Critical value
- The smallest |rho| that counts as significant for a given n and alpha.
- d (rank difference)
- Rank of X minus rank of Y for one case.
- Degrees of freedom (df)
- n − 2 for the Spearman t test.
- Fisher z transformation
- z = artanh(rho), which makes the sampling distribution close to normal for building intervals.
- Holm correction
- A step-down method that raises p-values when many pairs are tested, to control false positives.
- Kendall's tau-b
- A rank correlation based on concordant and discordant pairs, adjusted for ties.
- Monotonic
- Always moving in one direction: never rising then falling, or the reverse.
- n
- The number of complete pairs.
- Non-parametric test
- A test that does not assume a particular distribution such as the normal.
- Null hypothesis (H0)
- The claim that the population rho is zero.
- One-tailed test
- A test of a single predicted direction, positive or negative.
- Ordinal data
- Values that can be put in order but whose gaps may not be equal, such as Likert scores.
- p-value
- The probability of a rho at least this extreme if H0 were true.
- Pearson's r
- The correlation of the raw values, measuring a straight-line relationship.
- Permutation test
- A test that reshuffles the pairing many times to build the null distribution directly.
- Rank
- A value's position in the sorted list, with 1 for the smallest.
- rho (rs)
- Spearman's rank correlation coefficient, from −1 to +1.
- Tie
- Two or more equal values in the same variable.
- Two-tailed test
- A test that looks for a relationship in either direction.
📚 23. References
These peer-reviewed sources support the methods used in this Spearman rank correlation calculator: the coefficient itself, its exact and approximate significance tests, critical values, confidence intervals, comparisons with Pearson and Kendall, effect-size bands and multiple-testing control.
- Aickin, M., & Gensler, H. (1996). Adjusting for multiple testing when reporting research results: The Bonferroni vs Holm methods. American Journal of Public Health, 86(5), 726–728. https://doi.org/10.2105/AJPH.86.5.726
- Best, D. J., & Roberts, D. E. (1975). Algorithm AS 89: The upper tail probabilities of Spearman's rho. Journal of the Royal Statistical Society, Series C (Applied Statistics), 24(3), 377–379. https://doi.org/10.2307/2347111
- Bishara, A. J., & Hittner, J. B. (2012). Testing the significance of a correlation with nonnormal data: Comparison of Pearson, Spearman, transformation, and resampling approaches. Psychological Methods, 17(3), 399–417. https://doi.org/10.1037/a0028087
- Bishara, A. J., & Hittner, J. B. (2017). Confidence intervals for correlations when data are not normal. Behavior Research Methods, 49(1), 294–309. https://doi.org/10.3758/s13428-016-0702-8
- Bonett, D. G., & Wright, T. A. (2000). Sample size requirements for estimating Pearson, Kendall and Spearman correlations. Psychometrika, 65(1), 23–28. https://doi.org/10.1007/BF02294183
- Caruso, J. C., & Cliff, N. (1997). Empirical size, coverage, and power of confidence intervals for Spearman's rho. Educational and Psychological Measurement, 57(4), 637–654. https://doi.org/10.1177/0013164497057004009
- Cohen, J. (1992). A power primer. Psychological Bulletin, 112(1), 155–159. https://doi.org/10.1037/0033-2909.112.1.155
- Croux, C., & Dehon, C. (2010). Influence functions of the Spearman and Kendall correlation measures. Statistical Methods & Applications, 19(4), 497–515. https://doi.org/10.1007/s10260-010-0142-z
- de Winter, J. C. F., Gosling, S. D., & Potter, J. (2016). Comparing the Pearson and Spearman correlation coefficients across distributions and sample sizes: A tutorial using simulations and empirical data. Psychological Methods, 21(3), 273–290. https://doi.org/10.1037/met0000079
- Efron, B. (1979). Bootstrap methods: Another look at the jackknife. The Annals of Statistics, 7(1), 1–26. https://doi.org/10.1214/aos/1176344552
- Fieller, E. C., Hartley, H. O., & Pearson, E. S. (1957). Tests for rank correlation coefficients. I. Biometrika, 44(3/4), 470–481. https://doi.org/10.1093/biomet/44.3-4.470
- Fisher, R. A. (1915). Frequency distribution of the values of the correlation coefficient in samples from an indefinitely large population. Biometrika, 10(4), 507–521. https://doi.org/10.2307/2331838
- Gauthier, T. D. (2001). Detecting trends using Spearman's rank correlation coefficient. Environmental Forensics, 2(4), 359–362. https://doi.org/10.1006/enfo.2001.0061
- Hauke, J., & Kossowski, T. (2011). Comparison of values of Pearson's and Spearman's correlation coefficients on the same sets of data. Quaestiones Geographicae, 30(2), 87–93. https://doi.org/10.2478/v10117-011-0021-1
- Kendall, M. G. (1938). A new measure of rank correlation. Biometrika, 30(1–2), 81–93. https://doi.org/10.1093/biomet/30.1-2.81
- Puth, M.-T., Neuhäuser, M., & Ruxton, G. D. (2015). Effective use of Spearman's and Kendall's correlation coefficients for association between two measured traits. Animal Behaviour, 102, 77–84. https://doi.org/10.1016/j.anbehav.2015.01.010
- Schober, P., Boer, C., & Schwarte, L. A. (2018). Correlation coefficients: Appropriate use and interpretation. Anesthesia & Analgesia, 126(5), 1763–1768. https://doi.org/10.1213/ANE.0000000000002864
- Spearman, C. (1904). The proof and measurement of association between two things. The American Journal of Psychology, 15(1), 72–101. https://doi.org/10.2307/1412159
- Wasserstein, R. L., & Lazar, N. A. (2016). The ASA statement on p-values: Context, process, and purpose. The American Statistician, 70(2), 129–133. https://doi.org/10.1080/00031305.2016.1154108
- Zar, J. H. (1972). Significance testing of the Spearman rank correlation coefficient. Journal of the American Statistical Association, 67(339), 578–580. https://doi.org/10.1080/01621459.1972.10481251
