📚 Spearman’s Rank Correlation Test | 斯皮尔曼等级相关检验
In A-Level Biology, you are often required to analyse relationships between two variables, for example the relationship between light intensity and the number of daisy plants in a field. Spearman’s rank correlation is a statistical test that measures the strength and direction of a monotonic relationship between two variables. It works with ranked data, making it ideal for biological investigations where data are not normally distributed or are qualitative.
在 A-Level 生物学中,你经常需要分析两个变量之间的关系,例如光照强度与田野中雏菊数量之间的关系。斯皮尔曼等级相关是一种统计检验方法,用于衡量两个变量之间单调关系的强度和方向。它适用于等级数据,因此非常适合用于数据不符合正态分布或属于定性数据的生物调查。
1. What Is Spearman’s Rank Correlation? | 什么是斯皮尔曼等级相关?
Spearman’s rank correlation coefficient, written as rₛ (or sometimes ρ), is a number between −1 and +1 that indicates how closely two variables are related. A value of +1 shows a perfect positive correlation, meaning as one variable increases, the other always increases. A value of −1 shows a perfect negative correlation, meaning as one variable increases, the other always decreases. A value near 0 shows no consistent relationship.
斯皮尔曼等级相关系数,写作 rₛ(有时也用 ρ 表示),是一个介于 −1 到 +1 之间的数值,用于表示两个变量的相关程度。值为 +1 表示完全正相关,即一个变量增加时另一个变量总是增加;值为 −1 表示完全负相关,即一个变量增加时另一个变量总是减少;值接近 0 则表示两者没有一致的关联。
2. Why Use Spearman’s Rather Than Pearson’s? | 为什么用斯皮尔曼而不是皮尔逊?
Pearson’s correlation requires normally distributed, continuous data that form a straight-line relationship. In many ecological and physiological investigations, however, the relationship is not linear: it may be curved but still consistently increasing or decreasing. Spearman’s test does not require normal distribution, and it can handle ordinal (ranked) data such as “abundant”, “moderate”, “rare”.
皮尔逊相关要求数据呈正态分布且为连续变量,并且关系是直线型的。然而在许多生态学和生理学调查中,变量关系并不是线性的:可能是弯曲但仍然持续增加或减少。斯皮尔曼检验不要求正态分布,也能处理顺序(等级)数据,例如“丰富”“中等”“稀少”。
Spearman’s test is also less affected by outliers because all values are converted to ranks. If one extreme value would skew a Pearson calculation, converting to ranks reduces its influence. This makes Spearman’s rank a robust choice for field data with occasional extreme observations.
斯皮尔曼检验受异常值影响较小,因为所有数值都被转换为等级。如果某个极端值会使皮尔逊计算产生偏差,那么转换为等级后其影响会降低。这使得斯皮尔曼等级相关成为处理野外数据中偶发极端观测值的稳健选择。
3. Null Hypothesis and Significance | 零假设与显著性
Before performing any statistical test in A-Level Biology, you must state the null hypothesis (H₀). For Spearman’s rank correlation, the null hypothesis is: “There is no significant correlation between the two variables in the population.” The alternative hypothesis (H₁) is: “There is a significant correlation between the two variables.”
在 A-Level 生物学中进行任何统计检验之前,你必须写出零假设(H₀)。对于斯皮尔曼等级相关,零假设是:“总体中两个变量之间没有显著相关。”备择假设(H₁)是:“两个变量之间存在显著相关。”
After calculating rₛ, you compare it with a critical value from a statistical table at a chosen probability level, usually p = 0.05. If the calculated value is greater than or equal to the critical value, you reject the null hypothesis and conclude that there is a significant correlation. In exam questions, you must always quote the critical value and state whether your result is significant or not.
计算出 rₛ 之后,你需要将其与统计表中选定概率水平(通常 p = 0.05)下的临界值进行比较。如果计算值大于或等于临界值,则拒绝零假设,并得出结论:存在显著相关。在考试题目中,你必须引用临界值,并说明你的结果是否显著。
4. Step-by-Step: How to Rank the Data | 分步指南:如何排列数据等级
To carry out Spearman’s rank correlation, you first need to rank each set of measurements separately. Rank the values for variable X from smallest to largest, giving the smallest value rank 1, the next rank 2, and so on. Do the same for variable Y. If two or more values are identical, give each the average of the ranks they would have received.
要进行斯皮尔曼等级相关检验,首先需要分别对每组测量值排序。将变量 X 的值从小到大排列,最小值给等级 1,下一个给等级 2,依此类推。对变量 Y 也执行相同操作。如果有两个或多个数值相同,则给它们所占据的等级的平均值。
- Step 1: Write down your pairs of measurements for both variables.
- Step 2: Rank variable X independently from smallest to largest.
- Step 3: Rank variable Y independently from smallest to largest.
- Step 4: Calculate the difference d between the two ranks for each pair.
- Step 5: Square each difference to get d².
- Step 6: Sum all d² values.
Each pair of measurements must be kept together throughout the procedure. The ranking is carried out on each variable separately, but the difference is calculated per pair. This is why it is essential to label your data clearly before you begin.
每对测量值在整个过程中必须保持在一起。排名是对每个变量分别进行的,但差值是按每对数据计算的。这就是为什么在开始之前必须清楚地标记数据。
5. The Formula for Spearman’s Rank | 斯皮尔曼等级的公式
Once you have the sum of squared differences, ∑d², and the number of pairs, n, you can calculate rₛ using the formula:
一旦你得到了平方差之和 ∑d² 以及数据对数量 n,就可以使用以下公式计算 rₛ:
rₛ = 1 − (6 × ∑d²) / (n³ − n)
This formula is only valid when there are no tied ranks. If ties occur, you must use a corrected version, or you may use the alternative approach of calculating Pearson’s correlation coefficient on the ranks. In most A-Level questions, the uncorrected formula is acceptable unless the question specifically includes ties.
这个公式仅在不存在并列等级时有效。如果出现并列等级,你必须使用修正版公式,或者采用另一种方式:在等级数据上计算皮尔逊相关系数。在大多数 A-Level 题目中,除非题目特别包含并列等级,否则使用未修正公式是可以接受的。
6. Worked Example: Data and Ranks | 实例演算:数据与等级
Suppose a student investigates whether the number of mayfly larvae (per m²) decreases as the concentration of nitrate in a river (mg dm⁻³) increases. She collects data from eight sites.
假设一个学生调查河水中的硝酸盐浓度(mg dm⁻³)升高时蜉蝣幼虫数量(每平方米)是否下降。她收集了八个样点的数据。
| Site | Nitrate / mg dm⁻³ | Mayfly larvae / m² |
| 1 | 2.0 | 40 |
| 2 | 3.5 | 31 |
| 3 | 5.2 | 25 |
| 4 | 6.0 | 19 |
| 5 | 7.4 | 17 |
| 6 | 8.9 | 10 |
| 7 | 10.3 | 7 |
| 8 | 12.1 | 2 |
First, rank the nitrate concentrations from lowest (rank 1) to highest (rank 8). Then rank the mayfly counts from lowest (rank 1) to highest (rank 8). Notice that the largest nitrate value gets rank 8, but the largest mayfly density gets rank 8 as well. The ranks for each variable are calculated independently.
首先,将硝酸盐浓度从最低(等级 1)到最高(等级 8)排序。然后,将蜉蝣数量从最低(等级 1)到最高(等级 8)排序。注意,最大的硝酸盐值获得等级 8,但最大的蜉蝣密度也获得等级 8。两个变量的等级是独立计算的。
| Site | Nitrate rank | Mayfly rank | d | d² |
| 1 | 1 | 8 | −7 | 49 |
| 2 | 2 | 7 | −5 | 25 |
| 3 | 3 | 6 | −3 | 9 |
| 4 | 4 | 5 | −1 | 1 |
| 5 | 5 | 4 | 1 | 1 |
| 6 | 6 | 3 | 3 | 9 |
| 7 | 7 | 2 | 5 | 25 |
| 8 | 8 | 1 | 7 | 49 |
Note that the differences d are all negative for the first four sites and positive for the last four sites. This pattern indicates a negative relationship, but we still need the value of rₛ to know whether it is significant.
注意前四个样点的差值 d 全部为负数,后四个样点的差值为正数。这种模式表明存在负相关,但我们仍然需要计算 rₛ 来确定它是否显著。
7. Calculating rₛ | 计算 rₛ 的值
Now sum the d² column: 49 + 25 + 9 + 1 + 1 + 9 + 25 + 49 = 168. The number of pairs n = 8. Substitute into the formula:
现在将 d² 列求和:49 + 25 + 9 + 1 + 1 + 9 + 25 + 49 = 168。数据对数量 n = 8。将这些数值代入公式:
rₛ = 1 − (6 × 168) / (8³ − 8) = 1 − 1008 / 504 = 1 − 2 = −1
This gives rₛ = −1, a perfect negative correlation. In this idealised example, as nitrate concentration increases, mayfly larvae density decreases perfectly in rank order. In real data, you would rarely obtain the exact value −1, but it is possible in constructed exam questions.
计算得到 rₛ = −1,即完全负相关。在这个理想化的例子中,随着硝酸盐浓度增加,蜉蝣幼虫密度在等级顺序中完全递减。在真实数据中,很少能得到精确的 −1,但在构建的考试题目中有可能出现。
8. Interpreting the Result with Critical Values | 使用临界值解释结果
To decide whether the correlation is statistically significant, compare your calculated rₛ with the critical value for n = 8 at p = 0.05. For a two-tailed test with n = 8, the critical value is 0.738. Since −1 has an absolute value of 1, which is greater than 0.738, we reject the null hypothesis. The result is significant: there is a negative correlation between nitrate concentration and mayfly larvae density.
要判断该相关性是否具有统计显著性,需要将计算得到的 rₛ 与 n = 8 时 p = 0.05 的临界值进行比较。对于 n = 8 的双尾检验,临界值为 0.738。由于 −1 的绝对值为 1,大于 0.738,所以我们拒绝零假设。结果是显著的:硝酸盐浓度与蜉蝣幼虫密度之间存在负相关。
Important: The sign of rₛ tells you the direction, but significance is judged using the absolute value. A correlation of −0.9 is just as strong as a correlation of +0.9, only the direction is different. Examiners expect you to mention both the sign and the comparison with the critical value.
重要提示:rₛ 的正负号表示方向,但显著性判断使用绝对值。−0.9 的相关强度与 +0.9 相同,只是方向不同。考官期望你同时说明正负号以及与临界值的比较。
9. Tied Ranks and What to Do | 并列等级及其处理方法
When two or more values in one variable are identical, they share the same rank. For example, if two sites both have a nitrate concentration of 4.0 mg dm⁻³ and would occupy ranks 3 and 4, both are given the average rank 3.5. The same procedure applies to larger groups: if three values are tied for ranks 2, 3 and 4, each gets rank 3.
当一个变量中有两个或多个值相同时,它们共享相同的等级。例如,如果两个样点的硝酸盐浓度均为 4.0 mg dm⁻³,且原本应占等级 3 和 4,那么两者都获得平均等级 3.5。对于更大的并列组,适用同样的方法:如果三个值并列占据等级 2、3 和 4,则每个都获得等级 3。
If ties are present, the simple formula rₛ = 1 − 6∑d²/(n³ − n) becomes slightly inaccurate. A correction can be made using the Spearman rank correlation formula with adjusted sums, but this is beyond the typical A-Level requirement. In most examination contexts, you may use the standard formula unless the markscheme specifically requires a correction, and the question will usually indicate this.
如果存在并列等级,简单公式 rₛ = 1 − 6∑d²/(n³ − n) 会稍有不准。可以使用经过调整的斯皮尔曼等级相关公式进行修正,但这超出了 A-Level 的典型要求。在大多数考试情境下,除非评分标准特别要求修正,否则可以使用标准公式,题目通常会作出说明。
10. Common Exam Mistakes | 常见考试错误
Many students lose marks in this topic due to small but avoidable errors.
许多学生在这个知识点上失分,原因是细小但可以避免的错误。
- Forgetting to rank the variables separately: Ranks must be assigned to each variable on its own scale, not across both variables together.
- Mixing up the direction of ranking: Always rank from smallest to largest. If you rank from largest to smallest, the sign of rₛ reverses.
- Using n incorrectly: n is the number of pairs of measurements, not the total count of individual data values.
- Forgetting to square the differences: d must be squared before summing; otherwise negative values cancel positive ones.
- Not stating the null hypothesis: The null hypothesis must be written before the test, not after the conclusion.
- Omitting the critical value comparison: A conclusion of “significant” or “not significant” requires reference to the critical value at p = 0.05.
Pay special attention to the direction of ranking in exam questions. Some questions may ask you to rank from largest to smallest, but this is rare. If the question does not specify, always use the standard convention of smallest = rank 1.
请特别注意考试题目中排名的方向。有些题目可能要求从大到小排名,但这种情况很少见。如果题目没有说明,始终使用标准约定:最小值为等级 1。
11. Practice Checklist for Spearman’s Test | 斯皮尔曼检验练习清单
Use this checklist when answering a question on Spearman’s rank correlation in an exam.
在考试中回答斯皮尔曼等级相关题目时,请使用以下检查清单。
| Step | Action |
| 1 | State H₀: no significant correlation between variables. |
| 2 | Rank both variables separately from smallest to largest. |
| 3 | Calculate d for each pair and then d². |
| 4 | Find ∑d² and note n. |
| 5 | Substitute into rₛ = 1 − 6∑d²/(n³ − n). |
| 6 | Compare |rₛ| with the critical value for n and p = 0.05. |
| 7 | State whether to reject H₀ and describe the biological meaning. |
In the exam, show all your working. Even if you make a numerical error early, you can still gain method marks for the correct formula, correct table, and correct conclusion based on your calculated value.
考试中一定要展示全部计算过程。即使在早期发生数值错误,你仍然可以通过正确的公式、正确的表格以及基于你的计算值得出的正确结论获得方法分。
12. Conclusion | 总结
Spearman’s rank correlation is one of the three statistical tests you need for CIE A-Level Biology, alongside the chi-squared test and the Student’s t-test. It is specifically used to measure correlation between two variables using ranked data. Mastering the ranking procedure, the formula, and the interpretation of critical values will help you secure full marks in the statistical analysis portion of the exam.
斯皮尔曼等级相关是 CIE A-Level 生物学需要掌握的三种统计检验之一,另外两种是卡方检验和学生 t 检验。它专门用于使用等级数据来衡量两个变量之间的相关性。熟练掌握排名步骤、公式以及临界值的解释,将帮助你在考试的统计分析部分获得满分。
Always remember to write the null hypothesis first, rank carefully, compare your result with the critical value, and express your conclusion in the context of the biological question. With practice, Spearman’s rank becomes a straightforward and reliable tool in your data-analysis skills.
始终记得先写零假设,认真排名,将结果与临界值比较,并在生物学问题的背景下表达你的结论。通过练习,斯皮尔曼等级相关将成为你数据分析技能中简单而可靠的工具。
Published by TutorHao | Biology Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply