Spearman’s Rank Correlation Coefficient | 斯皮尔曼等级相关系数

📚 Spearman’s Rank Correlation Coefficient | 斯皮尔曼等级相关系数

Spearman’s rank correlation coefficient, denoted rₛ, measures the strength and direction of a monotonic relationship between two variables using their ranks rather than raw values. It is a core topic in Edexcel A-Level Mathematics statistics, appearing in both the applied papers and in hypothesis-testing questions.

斯皮尔曼等级相关系数(记作 rₛ)通过变量的秩(排名)而不是原始数值,来衡量两个变量之间单调关系的强度与方向。这是爱德思 A-Level 数学统计部分的核心考点,既出现在应用卷中,也常与假设检验结合出题。


1. What Is Spearman’s Rank Correlation? | 什么是斯皮尔曼等级相关?

Spearman’s rank correlation coefficient is a non-parametric measure of correlation. It tests whether one variable tends to increase (or decrease) as the other variable increases, without assuming a linear relationship or a particular distribution for the data.

斯皮尔曼等级相关系数是一种非参数的相关性度量。它检验当一个变量增大时,另一个变量是否倾向于随之增大(或减小),而不要求数据满足线性关系或特定分布假设。

The coefficient always lies in the range −1 ≤ rₛ ≤ 1. A value of 1 means perfect positive association between the ranks; −1 means perfect negative association; 0 means no apparent monotonic association.

该系数始终满足 −1 ≤ rₛ ≤ 1。当 rₛ = 1 时,排名之间呈完全正相关;rₛ = −1 时呈完全负相关;rₛ = 0 时表示不存在明显的单调关联。

Notice that Spearman’s coefficient is based on ranks, so it is not affected by outliers in the same way as Pearson’s correlation coefficient. It is often used when data are ordinal, or when the relationship is curved but still monotonic.

请注意,斯皮尔曼系数基于秩,因此它不像皮尔逊相关系数那样容易受异常值影响。当数据为定序数据,或者变量间关系虽然弯曲但仍是单调时,常常优先使用它。


2. When to Use Spearman’s Rank | 何时使用斯皮尔曼等级相关

In A-Level exam questions, you should choose Spearman’s rank when the data are rankings themselves, or when the relationship between the variables is not linear but still monotonic. For example, age and height of a child may show a positive monotonic relationship even if the graph is not a straight line.

在 A-Level 考试题中,当数据本身就是排名,或者两个变量之间的关系不是线性但仍然是单调时,应选择斯皮尔曼等级相关。例如,儿童年龄与身高之间可能呈正的单调关系,即使图形并非直线。

Typical contexts include judges’ rankings of contestants, survey responses on an ordered scale, and experimental data where measurements are converted into ranks.

典型背景包括:评委对参赛者的排名、定序量表的问卷调查结果,以及将测量值转化为秩的实验数据。

If the data are already numerical on a continuous scale and the scatter graph appears roughly linear, Pearson’s correlation is usually more powerful. However, exam points are often lost by using the wrong method, so always check whether the question says “use Spearman’s rank.”

如果数据本身是连续数值型的,且散点图大致呈线性,则皮尔逊相关通常更有效。然而考试中常因方法选用错误而失分,所以务必看清题中是否明确要求“使用斯皮尔曼等级相关”。


3. Ranking the Data | 对数据排序

To calculate rₛ, you first rank each variable separately. For each variable, assign rank 1 to the smallest value, rank 2 to the second smallest, and so on. The largest value receives rank n, where n is the number of pairs.

计算 rₛ 时,首先要分别对两个变量排序。对每个变量,将最小值记为秩 1,次小值记为秩 2,依此类推,最大值记为秩 n,其中 n 是配对数据个数。

It is helpful to create a table with columns: the original data values for variable x, ranks of x, original values for variable y, ranks of y, the difference d between the two ranks, and d².

最好列一张表,包含以下列:变量 x 的原始数值、x 的秩、变量 y 的原始数值、y 的秩、两个秩的差 d 以及 d²。

For example, if x values are 5, 9, 3, then the ranks are 2, 3, 1 respectively. The smallest value always takes rank 1.

例如,若 x 值为 5、9、3,则对应的秩分别为 2、3、1。最小值始终对应秩 1。


4. The Spearman Rank Formula | 斯皮尔曼秩公式

The standard formula for Spearman’s rank correlation coefficient in the Edexcel formula booklet is:

爱德思公式册中给出的斯皮尔曼等级相关系数标准公式为:

rₛ = 1 − (6 Σd²) / (n(n² − 1))

Here, d is the difference between the ranks of each paired observation, n is the number of pairs, and Σd² is the sum of the squared differences.

其中,d 是每对观测值秩的差,n 是配对数目,Σd² 是差的平方和。

The value 6 and the denominator n(n² − 1) come from the underlying mathematics of rank order. This formula is valid when there are no tied ranks; if ties exist, a modified version is needed, but for most Edexcel questions the basic formula is sufficient.

常数 6 和分母 n(n² − 1) 来自秩有关的数学推导。该公式在没有并列秩时成立;若存在并列秩,则需要修正公式,不过在绝大多数爱德思考题中基本公式已经完全够用。


5. Worked Example: Full Calculation | 完整计算示例

Consider the following data for 8 students showing their exam mark in Mathematics and their exam mark in Physics.

考虑 8 名学生的数学成绩与物理成绩,如下所示。

Student A B C D E F G H
Maths x 12 18 25 19 30 16 22 28
Physics y 20 22 28 18 32 25 30 35

Rank the x values and the y values separately. For x: 12 → 1, 16 → 2, 18 → 3, 19 → 4, 22 → 5, 25 → 6, 28 → 7, 30 → 8. For y: 18 → 1, 20 → 2, 22 → 3, 25 → 4, 28 → 5, 30 → 6, 32 → 7, 35 → 8.

分别对 x 和 y 排序。x:12 → 1,16 → 2,18 → 3,19 → 4,22 → 5,25 → 6,28 → 7,30 → 8。y:18 → 1,20 → 2,22 → 3,25 → 4,28 → 5,30 → 6,32 → 7,35 → 8。

Compute the differences d = rank(x) − rank(y). For A: 1 − 2 = −1, so d² = 1. B: 3 − 3 = 0, d² = 0. C: 6 − 5 = 1, d² = 1. D: 4 − 1 = 3, d² = 9. E: 8 − 7 = 1, d² = 1. F: 2 − 4 = −2, d² = 4. G: 5 − 6 = −1, d² = 1. H: 7 − 8 = −1, d² = 1.

计算 d = rank(x) − rank(y)。A:1 − 2 = −1,因此 d² = 1。B:3 − 3 = 0,d² = 0。C:6 − 5 = 1,d² = 1。D:4 − 1 = 3,d² = 9。E:8 − 7 = 1,d² = 1。F:2 − 4 = −2,d² = 4。G:5 − 6 = −1,d² = 1。H:7 − 8 = −1,d² = 1。

The sum is Σd² = 1 + 0 + 1 + 9 + 1 + 4 + 1 + 1 = 18. With n = 8, the denominator is n(n² − 1) = 8 × 63 = 504. Therefore:

平方和为 Σd² = 1 + 0 + 1 + 9 + 1 + 4 + 1 + 1 = 18。由于 n = 8,分母为 n(n² − 1) = 8 × 63 = 504。因此:

rₛ = 1 − (6 × 18) / 504 = 1 − 108/504 = 1 − 3/14 ≈ 0.786

This positive value close to 1 indicates a strong positive association between Maths and Physics marks.

该正值接近 1,说明数学成绩与物理成绩之间存在较强的正相关关系。


6. Tied Ranks | 并列秩的处理

If two or more values are equal, they share the mean of the ranks they would have taken. For example, if two values occupy positions 4 and 5, both receive rank 4.5, and the next value receives rank 6.

当两个或多个数值相等时,它们应取原本所占位置的秩的平均值。例如,若两个数值分别位于第 4 和第 5 位,则两者都得到秩 4.5,下一个数值得到秩 6。

After replacing the data with tied ranks, you use the same formula for rₛ. However, the formula is only approximate when ties are present. Edexcel generally expects this approximate value except in cases where the question explicitly requires a correction.

将并列数据替换为并列秩后,仍然使用相同的 rₛ 公式。然而当存在并列秩时,该公式只是近似公式。爱德思通常接受这一近似值,除非题目明确要求修正。

A common student error is to ignore ties and assign ranks arbitrarily. This changes the value of d and can lead to a completely different coefficient. Always use the average rank for tied data.

常见的错误是忽略并列秩而随意分配排名,这会改变 d 的值并可能导致完全不同的系数。对于并列数据,务必使用平均秩。


7. Hypothesis Testing with Spearman’s Rank | 基于斯皮尔曼系数的假设检验

In exam questions you may be asked to test whether there is significant evidence of association between two variables. The null hypothesis is usually H₀: ρₛ = 0, meaning no association. The alternative hypothesis is H₁: ρₛ ≠ 0 for a two-tailed test, or ρₛ > 0 / ρₛ < 0 for a one-tailed test.

在考试题中,你可能会被要求检验两个变量之间是否存在显著的关联。原假设通常为 H₀:ρₛ = 0,即没有关联。备择假设为 H₁:ρₛ ≠ 0(双侧检验),或 ρₛ > 0 / ρₛ < 0(单侧检验)。

Here ρₛ is the population Spearman rank correlation coefficient, and rₛ is the sample value calculated from data. The test is based on the distribution of rₛ under the null hypothesis.

其中 ρₛ 是总体斯皮尔曼等级相关系数,rₛ 是由样本数据计算得到的值。检验基于原假设下 rₛ 的分布。

You compare the calculated |rₛ| with a critical value from a Spearman’s rank table. A typical table is indexed by n and by the significance level. If |rₛ| exceeds the critical value, you reject H₀ and conclude there is significant evidence of association.

你需要将计算得到的 |rₛ| 与斯皮尔曼秩临界值表进行比较。临界值表通常按 n 和显著性水平列出。若 |rₛ| 超过临界值,则拒绝 H₀,并认为存在显著的关联证据。


8. Critical Values and Interpretation | 临界值与解释

For a small sample, Spearman’s critical values can be large. For example, with n = 8 at the 5% significance level for a two-tailed test, the critical value is often around 0.738. In the worked example above, rₛ ≈ 0.786, which exceeds 0.738, so the result would be significant at the 5% level.

对于小样本,斯皮尔曼临界值可能很大。例如,n = 8、显著性水平 5% 的双侧检验,临界值通常约为 0.738。在上述完整示例中,rₛ ≈ 0.786,超过 0.738,因此结果在 5% 水平下显著。

A significant result does not prove causation. It only provides evidence of a monotonic association in the observed data. You must mention this in your conclusion if asked to interpret the result in context.

显著结果并不证明因果关系。它只说明在观测数据中存在单调关联的证据。如果题目要求在情境中解释结果,你必须在结论中说明这一点。

Always state the conclusion in the context of the question. For instance, “There is significant evidence that students who score higher in Maths also tend to score higher in Physics.”

始终结合题目情境陈述结论。例如:“有显著证据表明,数学成绩越高的学生,物理成绩也往往越高。”


9. Spearman vs Pearson | 斯皮尔曼与皮尔逊的对比

Pearson’s correlation measures linear association using the original values, while Spearman’s rank measures monotonic association using ranks. If two variables have a strong but non-linear monotonic relationship, Spearman’s coefficient may be closer to 1 than Pearson’s.

皮尔逊相关系数使用原始数值衡量线性关联,而斯皮尔曼等级相关系数使用秩衡量单调关联。如果两个变量之间存在强烈但非线性的单调关系,斯皮尔曼系数可能比皮尔逊系数更接近 1。

Pearson’s coefficient is sensitive to outliers because it depends on actual magnitudes. Spearman’s coefficient is more robust because ranks are unaffected by a single very large or very small value, as long as its order remains the same.

皮尔逊系数对异常值敏感,因为它依赖于实际数值大小。斯皮尔曼系数则更稳健,因为只要单个极大或极小的值的排序不变,其秩就不受影响。

In Edexcel past-paper questions, you may be asked to compare the two. A good answer states that Spearman is appropriate when data are not normally distributed or when the relationship is not linear, while Pearson is more powerful for linear data.

在爱德思历年真题中,你可能需要比较两者。好的答案应指出:当数据不服从正态分布或关系非线性时,适合用斯皮尔曼;而当数据大致线性时,皮尔逊更有效。


10. Common Mistakes and Exam Tips | 常见错误与考试技巧

One frequent error is subtracting the original values instead of the ranks. Always verify that you are computing d from ranks, not from raw data. Another error is forgetting to divide by n(n² − 1) carefully, especially when n is small.

一个常见错误是对原始数值作差而不是对秩作差。务必确认 d 是由秩相减得到,而不是由原始数据相减。另一个错误是在计算 n(n² − 1) 时不够仔细,尤其是当 n 较小时。

Always show the formula and substitute the values clearly. Many marks are awarded for method, even if your final arithmetic is wrong. Round your final answer to 3 significant figures unless the question says otherwise.

始终展示公式并清晰代入数值。即使最终计算有误,方法步骤也能获得较多分数。除非题目另有说明,最终结果通常保留 3 位有效数字。

If the question provides a critical value, compare it directly with your computed rₛ. State whether you reject or do not reject H₀, and then translate that back into the context of the problem. A conclusion without context will lose marks.

若题目给出临界值,请将临界值与计算出的 rₛ 直接比较。说明是否拒绝 H₀,然后将结论放回题目情境中。没有情境的结论会失分。


11. Summary | 小结

Spearman’s rank correlation coefficient is a powerful non-parametric tool for measuring monotonic association. The key steps are: rank each variable, compute d and d², sum d², apply rₛ = 1 − (6Σd²)/(n(n² − 1)), and then compare with a critical value when testing hypotheses.

斯皮尔曼等级相关系数是一种衡量单调关联的有效非参数工具。关键步骤为:对每个变量排序,计算 d 与 d²,求 Σd²,代入 rₛ = 1 − (6Σd²)/(n(n² − 1)),并在假设检验时与临界值比较。

Remember to handle tied ranks using average ranks, and always interpret the coefficient in the context of the data. With careful table work and clear arithmetic, this topic is highly scoreable in the exam.

请记住,并列秩要使用平均秩,并且始终结合数据情境解释系数。只要表格整理仔细、计算清楚,这一知识点在考试中非常容易得分。

Published by TutorHao | Mathematics Revision Series | aleveler.com

更多咨询请联系16621398022(同微信)

Comments

屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from aleveler.com

Subscribe now to keep reading and get access to the full archive.

Continue reading