Spearman Footrule D Critical Value Lookup
What Is the Spearman Footrule?
The Spearman Footrule is a nonparametric statistic that measures the distance between two rank orderings by summing the absolute differences between paired ranks. It was introduced by the English statistician Charles Spearman in the early twentieth century alongside his better-known rank correlation coefficient.
Where Spearman's rho squares each rank difference, the Footrule uses the raw absolute difference. This makes it easier to compute by hand and gives each rank displacement equal weight, regardless of its size. A small D means strong agreement between the two orderings; a large D means substantial disagreement.
One-sentence definition (Featured Snippet): The Spearman Footrule statistic D is the sum of absolute rank differences between two orderings of the same n items: D = Σ|rᵢ − sᵢ|, where rᵢ and sᵢ are the ranks assigned to item i in each ordering. D = 0 indicates perfect agreement; D = D_max indicates maximum disagreement.
Spearman Footrule Critical Value Table
All values below are D_crit — the maximum D statistic that supports rejection of H₀ at the chosen significance level. Select the tab for your test direction and α. If your computed D ≤ D_crit, the rank agreement is statistically significant. Click any cell to load it into the lookup tool above.
Reject H₀ if computed D ≤ D_crit. D_max (even n) = n²/2; D_max (odd n) = (n²−1)/2. Critical values derived from the permutation distribution of D under H₀ of independent rankings, consistent with Diaconis & Graham (1977) and Gibbons & Chakraborti (2011). n = number of ranked items.
Spearman Footrule Formula
The Footrule statistic has a single, compact formula. No transformation or normalization is required before consulting the critical value table.
Core Formula
D = Spearman Footrule statistic | rᵢ = rank of item i in the first ordering | sᵢ = rank of item i in the second ordering | n = number of items | Σ = sum over all items
Expected Value and Variance Under H₀
Under the null hypothesis that the two rankings are independent, the Footrule statistic has the following theoretical moments:
These results allow a normal approximation for large n. For small n (≤ 30), the critical value table is more accurate and should be preferred.
Maximum Possible D
D_max = n² / 2
D_max = (n² − 1) / 2
Example: n = 5 (odd) → D_max = (25 − 1)/2 = 12. n = 6 (even) → D_max = 36/2 = 18. A normalized version of D can be computed as D / D_max, giving a value from 0 to 1 for cross-study comparisons.
Relationship to Spearman rho
Spearman's rho uses squared rank differences, whereas the Footrule uses absolute differences. The relationship between the two measures is:
D and Σ(rᵢ − sᵢ)² are both rank distance metrics on the same permutation, but they weight differences differently. A known bound is: Σ(rᵢ − sᵢ)² ≥ D²/(2n) (Diaconis & Graham, 1977), confirming that D is always smaller in magnitude than the squared sum used by rho.
How to Use the Spearman Footrule Table: Step by Step
The procedure below applies the Footrule test from raw data to a significance decision. Each step maps to a column in the worked example that follows.
Step 1 — Assign Ranks
Rank all n items independently in each variable from 1 (lowest or best) to n (highest or worst), according to your research convention. For tied values, assign the average (midpoint) rank. Label the first set of ranks rᵢ and the second set sᵢ.
Step 2 — Compute Absolute Rank Differences
For each item i, subtract the two ranks and take the absolute value:
Note: |rᵢ − sᵢ| is always a non-negative integer (or half-integer if midpoint ranks were used for ties).
Step 3 — Sum to Get D
Add all n absolute differences: D = Σ|rᵢ − sᵢ|. This is your test statistic. Verify that 0 ≤ D ≤ D_max before proceeding. An arithmetic error in the ranking or differencing step is the most common source of mistakes.
Step 4 — State Hypotheses and Choose α
H₁: The two rankings show significant positive agreement (one-tailed) or any systematic relationship (two-tailed).
α: Choose 0.05 or 0.01 before examining the data.
Step 5 — Look Up D Critical
Find the row for your n in the Spearman Footrule Table above. Select the column for your α and test direction. The cell value is D_crit. Use the calculator at the top of this page for a direct lookup.
Step 6 — Apply the Decision Rule
If D > D_crit → Fail to reject H₀ → Rankings do not agree significantly at α
The Footrule decision rule is the reverse of most tests: smaller D means more agreement, so significance corresponds to D being small enough to fall below D_crit.
Worked Example: Spearman Footrule from Raw Data
Scenario: A professor asks two evaluators to independently rank six student essays (A through F) from best (1) to worst (6). The professor wants to know whether the two evaluators agree significantly on the ranking order at α = 0.05 (two-tailed).
Step 1 & 2 — Ranks and Absolute Differences
| Essay | Evaluator 1 Rank (rᵢ) | Evaluator 2 Rank (sᵢ) | |rᵢ − sᵢ| |
|---|---|---|---|
| A | 1 | 2 | 1 |
| B | 2 | 1 | 1 |
| C | 3 | 4 | 1 |
| D | 4 | 3 | 1 |
| E | 5 | 6 | 1 |
| F | 6 | 5 | 1 |
Steps 3–6 — Test and Decision
| Step | Action | Result |
|---|---|---|
| 1 | Compute D | D = Σ|rᵢ − sᵢ| = 6 |
| 2 | State hypotheses, set α | H₀: independent; H₁: agreement; α = 0.05, two-tailed |
| 3 | Record n | n = 6 |
| 4 | Look up D_crit | n=6, α=0.05, two-tailed → D_crit = 8 |
| 5 | Compare D vs D_crit | D = 6 ≤ D_crit = 8 → Reject H₀ ✓ |
Interpretation
With n = 6 and D = 6 at α = 0.05 (two-tailed), the two evaluators' rankings of the six essays agree to a degree that is statistically significant. D = 6 falls at or below the critical value D_crit = 8, so we reject H₀ of independent rankings. The two evaluators share a similar view of essay quality, not merely by chance. D_max for n = 6 is 18, so D = 6 represents only 33% of the maximum possible disagreement.
Worked Example 2: Comparing Expert and Public Rankings
Scenario: A music magazine and an online public poll both rank the same 8 albums of the year (numbered 1–8). Do the expert critics and the general public rank these albums similarly? Test at α = 0.05 (two-tailed).
| Album | Critics Rank (rᵢ) | Public Rank (sᵢ) | |rᵢ − sᵢ| |
|---|---|---|---|
| 1 | 1 | 3 | 2 |
| 2 | 2 | 1 | 1 |
| 3 | 3 | 2 | 1 |
| 4 | 4 | 6 | 2 |
| 5 | 5 | 4 | 1 |
| 6 | 6 | 5 | 1 |
| 7 | 7 | 8 | 1 |
| 8 | 8 | 7 | 1 |
Decision and Interpretation
D = 10 ≤ D_crit = 14 at α = 0.05 (two-tailed): reject H₀. Critics and the public rank the eight albums with statistically significant agreement. D = 10 out of a possible D_max = 32 (n = 8, even) represents only 31% of the maximum possible disagreement — a low footrule distance consistent with substantial consensus.
Spearman Footrule vs Spearman Rank Correlation vs Kendall's Tau
These three nonparametric rank association measures are related but answer slightly different questions and weight rank differences differently. The table below summarizes the key distinctions.
| Feature | Spearman Footrule | Spearman Rank Correlation (ρ) | Kendall's Tau (τ) |
|---|---|---|---|
| Formula type | Σ|rᵢ − sᵢ| | 1 − 6Σd²/[n(n²−1)] | (C − D)/[n(n−1)/2] |
| Range | 0 to D_max | −1 to +1 | −1 to +1 |
| Rank difference weighting | Equal (absolute) | Squared (larger differences weighted more) | Pairwise concordance |
| Ties handling | Midpoint ranks | Correction formula available | Tau-b or Tau-c correction |
| Computation effort | Very easy (subtract, sum) | Moderate (square, sum) | More complex (count pairs) |
| Significance table available | Yes (this table) | Yes | Yes |
| Statistical power | Slightly lower than ρ | Standard reference | Comparable to ρ |
| Common in information retrieval | Yes | Less common | Less common |
| Best use case | Rank list comparison, IR evaluation | General nonparametric correlation | Concordance counting, small samples |
Computing the Spearman Footrule in R and Python
The Footrule is not built into most statistical packages by default, but it takes only a few lines of code to compute it in either R or Python.
R Implementation
r <- c(1, 2, 3, 4, 5, 6)
s <- c(2, 1, 4, 3, 6, 5)
# Spearman Footrule
D <- sum(abs(r - s))
cat("D =", D, "\n")
# D_max for n=6 (even)
n <- length(r)
D_max <- n^2 / 2
cat("D_max =", D_max, "\n")
# Normalized footrule
cat("D / D_max =", D / D_max)
Python Implementation
# Two rank arrays
r = np.array([1, 2, 3, 4, 5, 6])
s = np.array([2, 1, 4, 3, 6, 5])
# Spearman Footrule
D = np.sum(np.abs(r - s))
print(f"D = {D}")
# D_max for n=6 (even)
n = len(r)
D_max = n**2 / 2
print(f"D_max = {D_max}")
# Normalized
print(f"D/D_max = {D/D_max:.3f}")
Permutation Test for Exact P-values
For large n or when you need an exact p-value (rather than the tabulated critical value), a permutation test is the most reliable approach. In R, the coin package provides nonparametric permutation tests, and in Python, scipy.stats.permutation_test can compute the exact distribution of D under H₀ by enumeration or Monte Carlo sampling.
Common Mistakes When Using the Spearman Footrule Table
Students and researchers encounter the same errors repeatedly. The list below covers the most frequent pitfalls and how to avoid each one.
Mistake 1: Applying the Wrong Decision Rule
Unlike most test statistics where a large value is significant, the Footrule is significant when D is small. Reject H₀ when D ≤ D_crit, not when D ≥ D_crit. This reversal catches many students off guard because it is the opposite of the logic used in t-tests or chi-square tests.
Mistake 2: Ranking Each Variable Relative to the Other
Ranks must be assigned within each variable separately, from 1 to n. Do not compare raw scores across the two variables. Variable 1 has ranks 1 through n and so does Variable 2 — they are independent rank assignments of the same set of items.
Mistake 3: Confusing D with Spearman rho
D and rho are both rank correlation measures but are not interchangeable. D is an absolute count (the total displacement); rho is a bounded coefficient from −1 to +1. Do not look up a D value in the Spearman rank correlation table or vice versa.
Mistake 4: Ignoring Ties
Ties require midpoint (average) ranks. Assigning the lower or higher rank to tied values biases D and invalidates the table lookup. If there are many ties (more than 20% of the data), consider a correction or a permutation test instead of relying on the standard table.
Mistake 5: Using the Table for n > 30
The standard Footrule critical value table covers n = 4 to n = 30. For larger samples, use the normal approximation based on E[D] and Var[D], or compute an exact p-value using permutation methods. The table's exact critical values do not extend beyond n = 30 in most references.
Decision Guide: When to Use the Spearman Footrule
This guide helps you choose between the Footrule and its alternatives based on your research context and data characteristics.
Use Spearman Footrule when…
- You need a simple, hand-calculable rank distance
- You are evaluating ranked lists (search results, recommendations)
- You want equal weight on all rank displacements
- Your sample size is small (n ≤ 30) and you want exact critical values
- You are comparing two judges' or raters' orderings
Use Spearman rho when…
- You want a bounded coefficient comparable to Pearson r
- Large rank displacements matter more than small ones
- You need to report a standardized correlation coefficient
- Your data are ordinal with no inherent distance meaning
- You want to use the Spearman correlation table
Use Kendall's Tau when…
- You prefer to measure pairwise concordance and discordance
- You have a large number of ties to handle
- You want a measure with a clearer probabilistic interpretation
- You are working in a partial ranking setting
- You need a robust measure for ordinal regression contexts
Symbol and Concept Glossary
Every term and symbol used in the Spearman Footrule test is defined below, along with the most common misinterpretation for each.
| Symbol / Term | Definition | Common Error |
|---|---|---|
| D | Spearman Footrule statistic — sum of absolute rank differences Σ|rᵢ − sᵢ| | Confusing D with a correlation coefficient |
| D_crit | Critical value from the table — maximum D that is still statistically significant | Rejecting H₀ when D > D_crit (reversed rule) |
| D_max | Maximum possible D. D_max = n²/2 (even n) or (n²−1)/2 (odd n) | Using wrong formula for even vs odd n |
| rᵢ | Rank assigned to item i in the first ordering (1 to n) | Using raw scores instead of ranks |
| sᵢ | Rank assigned to item i in the second ordering (1 to n) | Ranking across variables rather than within each |
| n | Number of items ranked in each ordering | Counting total observations rather than ranked items |
| α | Significance level (probability of Type I error); typically 0.05 or 0.01 | Setting α after seeing the data |
| H₀ | Null hypothesis: the two rankings are independent (no systematic agreement) | Treating fail-to-reject as proof of independence |
| Footrule distance | Same as D — the L¹ distance between two permutations in permutation theory | Confusing with Kendall tau distance (pairwise swaps) |
| Nonparametric test | A test that makes no assumption about the population distribution; ranks only | Assuming the Footrule requires normal data |
Frequently Asked Questions
Can the Spearman Footrule produce a negative D value?
No. Because D sums absolute values of rank differences, it is always ≥ 0. D = 0 occurs only when the two orderings are identical. Unlike Spearman rho or Kendall's Tau, the Footrule statistic has no negative range — it measures raw distance, not signed correlation.
Is the Spearman Footrule used in information retrieval and search engines?
Yes. The Footrule is a standard evaluation metric in information retrieval. Researchers use it to measure how far apart two ranked lists of search results are. Diaconis and Graham's 1977 paper established its theoretical properties, and it remains widely cited in search engine evaluation literature. Its L¹ distance interpretation makes it natural for measuring list-to-list differences in ranking quality.
What sample size is the Spearman Footrule Table valid for?
The exact critical value table on this page covers n = 4 through n = 30. For n below 4, there are too few possible permutations to achieve conventional significance levels. For n above 30, the normal approximation based on E[D] and Var[D] works reasonably well, or a permutation test provides exact p-values without relying on the table.
Does significance depend on the direction of the test (one-tailed vs two-tailed)?
For the Footrule's most common use (testing whether two rankings agree), a one-tailed test toward small D is appropriate — you are specifically looking for agreement, not just any deviation from independence. A two-tailed test tests whether the two rankings are either significantly similar or significantly different from what would be expected by chance. In practice, most studies use the one-tailed test at α = 0.05, checking whether the rankings are closer together than chance predicts.
How does the Footrule relate to the Kendall tau distance?
The Kendall tau distance K counts the minimum number of pairwise adjacent transpositions needed to convert one ranking into another. It differs from the Footrule D in that K counts swaps rather than absolute position changes. A fundamental result from Diaconis and Graham (1977) states that K ≤ D ≤ 2K for any permutation, bounding the relationship between the two measures. They measure the same thing at different scales.
Can I apply the Spearman Footrule in Excel?
Yes, straightforwardly. In Excel, list your two rank columns, compute a third column as =ABS(A2−B2) for each row, then use =SUM() to get D. Excel's RANK.AVG function handles ties with midpoint ranks automatically. Compare the resulting D against D_crit from this table to reach your significance decision. No add-in or special function is required.
References and Further Reading
Diaconis, P., & Graham, R. L. (1977). Spearman's footrule as a measure of disarray. Journal of the Royal Statistical Society: Series B (Methodological), 39(2), 262–268. doi:10.1111/j.2517-6161.1977.tb01624.x — The foundational paper establishing the mathematical properties of the Footrule and its relationship to Kendall's tau distance.
Gibbons, J. D., & Chakraborti, S. (2011). Nonparametric Statistical Inference (5th ed.). CRC Press. — Comprehensive coverage of rank-based nonparametric tests including the Spearman Footrule with critical value tables and worked examples. routledge.com
Spearman, C. (1906). A footrule for measuring correlation. British Journal of Psychology, 2(1), 89–108. — Original paper by Charles Spearman proposing the footrule as a simple, practical rank correlation measure and introducing the formula D = Σ|rᵢ − sᵢ|.
NIST/SEMATECH e-Handbook of Statistical Methods. Section 7.4: Rank Correlation. National Institute of Standards and Technology. itl.nist.gov — U.S. government statistical reference covering rank correlation methods, including computational procedures and interpretation guidance.
Fagin, R., Kumar, R., & Sivakumar, D. (2003). Comparing top k lists. SIAM Journal on Discrete Mathematics, 17(1), 134–160. doi:10.1137/S0895480102412856 — Influential information retrieval paper on using the Footrule to evaluate ranked lists in search engine and recommendation system contexts.
Hollander, M., Wolfe, D. A., & Chicken, E. (2014). Nonparametric Statistical Methods (3rd ed.). Wiley. — Standard textbook reference for rank correlation methods with tables and worked examples for the Footrule and related tests. wiley.com
Related Statistical Tables & Resources
Understanding What the Footrule Table Tells You
Why D_crit Increases as n Increases
With larger n, the expected value of D under H₀ also grows (E[D] = n(n+1)/3). So a larger absolute footrule distance can still be consistent with chance agreement. What matters is not the raw size of D but its position relative to the distribution of D under H₀ — which the table encodes for each n and α.
The L¹ Geometry of the Footrule
In the mathematics of permutations, D is the L¹ (Manhattan) distance between two permutations. This geometric interpretation makes the Footrule a natural choice in machine learning and combinatorial optimization problems where L¹ distances arise. The well-known relationship between correlation and distance applies here too.
The Footrule and Rank Correlation in Practice
Whether you use the Footrule, Spearman rank correlation, or Kendall's Tau, the underlying question is the same: do two orderings agree beyond what chance alone would produce? The three measures give similar answers in most practical situations. The Footrule's advantage is its arithmetic simplicity, making it accessible for teaching and for hand verification of software output.