M1-078M1: Mathematics & Statistics FundamentalsHypothesis TestingMedium
Mastery:
Hypothesis Testing: 解释 Wilcoxon 秩和检验与它的适用场景。
📐 Mathematical Definition
⚡ Executive Summary
Core Concept: 非参数检验,用秩代替数值比较两组;对异常值与重尾数据鲁棒,不要求正态。
📌 Key Takeaways
- •检验的是'一组是否随机大于另一组'(位置差异)
- •对异常值鲁棒(秩不受极端值影响)
- •大样本下 U 近似正态
📐 Mathematical Derivations
Wilcoxon 秩和检验(= Mann-Whitney U 检验)的做法:把两组数据<strong>混合后排序</strong>,用秩(而非原始值)计算统计量 U;若两组来自同一分布,则秩应在两组间随机分配。<strong>与 t 检验的关键差异</strong>:① <strong>假设更弱</strong>——不要求正态分布,只要求两组分布形状相同(若不同则检验的是'随机占优');② <strong>对异常值鲁棒</strong>——秩不受极端值大小影响(最大值与次大值只差一个秩),故重尾数据下比 t 检验稳健得多;③ <strong>功效</strong>——数据确实正态时,t 检验功效更高(约高 5%);数据重尾时秩和检验功效显著更高。<strong>原假设的精确表述</strong>:H₀ 为'两组来自同一分布'(或更弱:P(X>Y)=P(X<Y)=0.5),备择为'一组随机大于另一组'——注意这比 t 检验的'均值相等'更一般(不依赖均值的存在性)。
🏭 Production Trade-offs
实践要点:① <strong>何时使用</strong>——数据重尾(如延迟、收入、点击次数)、样本量小、有序(等级)数据、含异常值;A/B 测试中若指标是重尾分布(如人均消费),秩和检验比 t 检验更可靠。② <strong>对应的配对版本</strong>——配对数据用 <strong>Wilcoxon 符号秩检验</strong>(对差值取绝对值后排序,考虑符号);两组独立则用秩和检验。③ <strong>多组比较</strong>——用 <strong>Kruskal-Wallis 检验</strong>(ANOVA 的非参数对应)替代多次秩和检验。④ <strong>局限</strong>——若两组分布<strong>形状不同</strong>(方差差异大),秩和检验的解读复杂(不再是单纯的位置差异);此时可用 <strong>Brunner-Munzel 检验</strong>。⑤ <strong>A/B 测试的实践选择</strong>——工业界常用 <strong>bootstrap</strong> 替代秩和检验,因为它能直接给出效应量与置信区间(而秩和检验只给 p 值),且对任意统计量(均值、中位数、分位数)都适用;两者都属'无分布假设'路线。⑥ <strong>报告的完整性</strong>——非参数检验应同时报告<strong>效应量</strong>(如中位数差、Cliff's delta、或概率优势 P(X>Y)),而非只报 p 值。
⚠️ Common Interview Pitfalls
- ✕对重尾/含异常值的数据直接用 t 检验
- ✕两组分布形状不同时按'位置差异'解读秩和检验
🎯 Interviewer Follow-ups
- ?秩和检验与 t 检验的功效差异?
- ?它检验的原假设是什么?
📚
Associated Knowledge Base Guides & Mindmaps
Explore the comprehensive technical article, exam cards, and global architecture tree.