📚 PDF资源导航

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

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

Spearman’s rank correlation coefficient, denoted by \( r_s \) (though we write it as \( r_s \) using plain text), measures the strength and direction of a monotonic relationship between two variables. It is a non-parametric alternative to Pearson’s product-moment correlation coefficient, meaning it does not require the data to be normally distributed.

斯皮尔曼等级相关系数(通常记作 \( r_s \),本文使用纯文本形式表示)用于衡量两个变量之间单调关系的强度和方向。它是皮尔逊积矩相关系数的非参数替代方法,意味着它不要求数据服从正态分布。


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

Spearman’s coefficient is calculated on the ranks of the data, not the raw data values. If two variables tend to increase together, \( r_s \) is close to +1; if one tends to increase while the other decreases, \( r_s \) is close to -1; if there is no monotonic tendency, \( r_s \) is close to 0.

斯皮尔曼相关系数基于数据的排名而非原始数值进行计算。如果两个变量倾向于同增,\( r_s \) 接近 +1;如果一个增加而另一个减少,\( r_s \) 接近 -1;如果没有单调趋势,\( r_s \) 接近 0。

Key properties:

关键性质:

  • \( r_s \) always lies in the interval [-1, 1].
  • \( r_s \) is unaffected by outliers in the raw data because it uses ranks.
  • \( r_s \) detects monotonic relationships, not necessarily linear ones.
  • \( r_s \) 的取值范围始终在 [-1, 1] 之内。
  • \( r_s \) 使用排名,因此不受原始数据中异常值的影响。
  • \( r_s \) 检测的是单调关系,而不一定是线性关系。

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

You should consider using Spearman’s rank correlation when one or more of the following situations apply:

当出现以下一种或多种情况时,应考虑使用斯皮尔曼等级相关:

  • The data is ordinal (e.g. ranking of exam results, survey responses).
  • The relationship between variables appears monotonic but not linear.
  • The data contains outliers or is heavily skewed.
  • A sample size is small and normality cannot be assumed.
  • 数据是有序分类数据(例如考试成绩排名、调查问卷答案)。
  • 变量之间的关系看起来是单调的但不是线性的。
  • 数据包含异常值或严重偏态。
  • 样本量较小,无法假设正态性。

In IB Mathematics Analysis and Approaches, Spearman’s rank is part of the Applications and Interpretation topics, but it also appears in statistics sections of both SL and HL courses.

在 IB 数学分析与方法(AA)中,斯皮尔曼等级相关属于应用与解释(AI)的统计内容,但它也出现在 SL 和 HL 课程的统计部分中。


3. The Formula for Spearman’s Rank | 斯皮尔曼等级相关系数的公式

When there are no tied ranks, the formula is:

当没有并列排名时,公式为:

rₛ = 1 – (6 × Σdᵢ²) / (n × (n² – 1))

where \( d_i \) is the difference between the ranks of the \( i \)-th observation for each variable, and \( n \) is the number of pairs.

其中 \( d_i \) 是第 \( i \) 组观测值在两个变量上的排名之差,\( n \) 是数据对的数量。

Note: If tied ranks exist, we use the same formula but replace the values with averaged ranks. The formula becomes a simplified version of the general rank correlation formula.

注意:如果存在并列排名,我们使用相同的公式,但将排名替换为平均排名。此时公式是通用等级相关系数公式的简化形式。


4. Step-by-Step Calculation: Basic Example | 分步计算:基础例题

Suppose a teacher records the hours studied and the exam scores for 5 students:

假设一位老师记录了 5 名学生的学习小时数和考试成绩:

Student Hours Score
A 2 55
B 4 60
C 6 75
D 8 80
E 10 95

Step 1: Rank each variable from smallest to largest (rank 1 = smallest).

步骤 1: 对每个变量从小到大排名(最小值为等级 1)。

Step 2: Compute the difference \( d_i \) for each pair, then square it.

步骤 2: 计算每对排名之差 \( d_i \),然后求平方。

Hours rank Score rank d
1 1 0 0
2 2 0 0
3 3 0 0
4 4 0 0
5 5 0 0

Step 3: Sum \( d^2 = 0 \). Substitute into the formula:

步骤 3: 求和 \( Σd² = 0 \)。代入公式:

rₛ = 1 – (6 × 0) / (5 × (25 – 1)) = 1

The perfect positive monotonic relationship gives \( r_s = 1 \).

完美正单调关系得到 \( r_s = 1 \)。


5. Handling Tied Ranks | 处理并列排名

When two or more values are equal, assign each the average of the ranks they would have occupied. For example, if the fourth and fifth values are equal, both receive rank 4.5.

当两个或多个数值相等时,为它们分配原本所占排名的平均值。例如,如果第 4 和第 5 个数值相等,则两者都获得排名 4.5。

Example: Scores: 60, 70, 70, 80, 90

示例: 分数:60, 70, 70, 80, 90

  • 60 is rank 1.
  • The two 70s occupy ranks 2 and 3, so each gets rank 2.5.
  • 80 is rank 4.
  • 90 is rank 5.
  • 60 的排名为 1。
  • 两个 70 占据排名 2 和 3,因此每个都获得 2.5。
  • 80 的排名为 4。
  • 90 的排名为 5。

If ties appear in either variable, the simplified formula above is no longer exactly equal to the general rank correlation formula. However, in many IB exam contexts, the simplified formula is still accepted if the number of ties is small, or you may be instructed to use a calculator.

如果任一变量中出现并列,上述简化公式与通用等级相关公式不再完全相等。但在许多 IB 考试情境中,如果并列数量较少,简化公式仍可接受,或者题目会要求使用计算器。


6. Worked Example with Tied Ranks | 含并列排名的完整例题

Consider two judges ranking 6 contestants, where Judge X gives two identical scores:

考虑两位评委对 6 名参赛者评分,其中评委 X 给出两个相同分数:

Contestant Judge X Judge Y
A 12 50
B 15 55
C 15 60
D 18 62
E 20 65
F 22 70

Ranking X: 12 → 1; the two 15s take ranks 2 and 3, so both get 2.5; 18 → 4; 20 → 5; 22 → 6.

变量 X 的排名: 12 → 1;两个 15 占据排名 2 和 3,所以均为 2.5;18 → 4;20 → 5;22 → 6。

Ranking Y: 50 → 1; 55 → 2; 60 → 3; 62 → 4; 65 → 5; 70 → 6.

变量 Y 的排名: 50 → 1;55 → 2;60 → 3;62 → 4;65 → 5;70 → 6。

Rank X Rank Y d
1 1 0 0
2.5 2 0.5 0.25
2.5 3 -0.5 0.25
4 4 0 0
5 5 0 0
6 6 0 0

Σd² = 0.25 + 0.25 = 0.5

rₛ = 1 – (6 × 0.5) / (6 × (36 – 1)) = 1 – 3/210 ≈ 0.9857

Thus there is a very strong positive association between the judges’ scores.

因此评委之间的评分存在非常强的正相关关系。


7. Using Your GDC to Calculate rₛ | 使用图形计算器计算 rₛ

In the IB exam, you may use a GDC to compute Spearman’s rank quickly. Enter the data into two lists, then choose the Spearman rank option in the statistics or correlation menu. On most calculators this is found under the “Test” or “Dist” menus if you are doing a hypothesis test, or under “2-Var Stats” in some models.

在 IB 考试中,可以使用图形计算器(GDC)快速计算斯皮尔曼等级相关系数。将数据输入两个列表,然后在统计或相关菜单中选斯皮尔曼等级选项。在大多数计算器上,这可以在“检验”或“分布”菜单中找到,或者在某些型号的“双变量统计”中找到。

Always double-check whether your calculator is asking for raw data or ranked data. If the calculator requires ranking, you must rank the data manually first.

始终确认计算器要求的是原始数据还是排名数据。如果计算器要求排名,必须先手动对数据进行排名。


8. Hypothesis Testing with Spearman’s Rank | 使用斯皮尔曼等级相关进行假设检验

You can perform a hypothesis test to determine whether the population Spearman rank correlation coefficient \( \rho_s \) is significantly different from zero.

可以进行假设检验,以判断总体斯皮尔曼等级相关系数 \( \rho_s \) 是否显著不等于零。

Null hypothesis: \( H_0: \rho_s = 0 \) (no monotonic association).

备择假设: \( H_1: \rho_s \neq 0 \) (there is a monotonic association).

原假设: \( H_0: \rho_s = 0 \)(不存在单调关联)。

备择假设: \( H_1: \rho_s \neq 0 \)(存在单调关联)。

The test statistic is \( r_s \) itself. Compare it with the critical values from the Spearman rank table, which depend on the sample size \( n \) and the significance level (e.g. 5% one-tailed or two-tailed).

检验统计量就是 \( r_s \) 本身。将其与斯皮尔曼等级临界值表比较,临界值取决于样本量 \( n \) 和显著性水平(例如 5% 的单尾或双尾检验)。


9. Critical Values and Interpretation | 临界值与结果解释

For small samples, the critical values are found in a Spearman rank table. For example, for \( n = 6 \) at the 5% significance level for a two-tailed test, the critical value is about 0.886. If your computed \( |r_s| > 0.886 \), you reject \( H_0 \).

对于小样本,可在斯皮尔曼等级表中查询临界值。例如,当 \( n = 6 \)、显著性水平 5% 且为双尾检验时,临界值约为 0.886。如果计算的 \( |r_s| > 0.886 \),则拒绝 \( H_0 \)。

n (pairs) Critical value (5%, two-tailed)
5 1.000
6 0.886
7 0.786
8 0.738
9 0.700
10 0.648

As \( n \) increases, the critical value decreases, meaning that smaller correlations can be considered significant with larger samples.

随着 \( n \) 增大,临界值减小,这意味着在样本量较大时,较小的相关系数也可能被认为是显著的。


10. Common Mistakes to Avoid | 常见错误提醒

  • Forgetting to rank both variables before calculating.
  • Using raw data differences instead of rank differences.
  • Ignoring tied ranks and using the simple formula without averaging.
  • Confusing +1, -1, and 0 with linear correlation rather than monotonic correlation.
  • Using the wrong critical value (e.g. one-tailed vs two-tailed).
  • 忘记在计算前对两个变量进行排名。
  • 使用原始数据之差而不是排名之差。
  • 忽略并列排名,未使用平均排名。
  • 将 +1、-1、0 与线性相关混淆,而它们是单调相关。
  • 使用了错误的临界值(例如单尾与双尾混淆)。

11. Spearman vs Pearson | 斯皮尔曼与皮尔逊的比较

Pearson’s correlation measures linear relationships and requires numerical data that is approximately normally distributed for inference. Spearman’s correlation uses ranks and measures monotonic relationships, making it more robust.

皮尔逊相关系数衡量线性关系,并要求数值数据近似正态分布才能进行推断。斯皮尔曼相关系数使用排名,衡量单调关系,因此更加稳健。

Which one should you choose?

应该选择哪一个?

  • If a scatter plot shows a straight-line pattern, use Pearson.
  • If the pattern is consistently increasing but curved, or if data is ordinal, use Spearman.
  • 如果散点图呈直线模式,使用皮尔逊相关。
  • 如果模式持续上升但呈曲线,或者数据是有序分类数据,使用斯皮尔曼相关。

12. Exam-Style Questions and Tips | 考试题型与备考建议

IB exam questions often give you a table of raw data and ask you to calculate Spearman’s rank. They may then ask you to interpret the value and conduct a hypothesis test using the provided critical value.

IB 考题通常给出一个原始数据表,要求计算斯皮尔曼等级相关系数,然后要求解释该值,并使用提供的临界值进行假设检验。

Tip 1: Present a clean table with ranks and \( d^2 \) values. This shows clear working and earns method marks.

建议 1: 列出清晰的排名和 \( d² \) 表格。这样可以展示完整过程并获得方法分。

Tip 2: Always state whether the value is positive or negative and write a conclusion in context.

建议 2: 始终说明数值为正还是负,并结合题目背景写出结论。

Tip 3: If using a GDC, write down the command used and the output, e.g. “Using GDC: \( r_s = 0.943 \).”

建议 3: 如果使用计算器,写下所用指令和输出,例如“使用 GDC:\( r_s = 0.943 \)”。

Tip 4: Don’t forget to compare \( r_s \) with the critical value and make a final decision about \( H_0 \).

建议 4: 不要忘记将 \( r_s \) 与临界值比较,并对 \( H_0 \) 作出最终判断。


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