為什麼一定要校正?
若每個檢定的 α=0.05,跑 10,000 個獨立檢定,期望就有 500 個假陽性。早期生物醫學論文只用單一 p < 0.05 列入「顯著」基因,導致 reproducibility crisis 的主因之一。
多重檢定校正分兩派:(1) FWER (Family-Wise Error Rate):控制「至少一個假陽性」的機率,代表如 Bonferroni、Holm;保守、適合驗證關鍵假設。(2) FDR (False Discovery Rate):控制顯著結果中假陽性的比例,代表 Benjamini-Hochberg (1995) 與 Storey q-value (2003);功效高,組學分析標準。
If each test uses α=0.05 and you run 10,000 independent tests, you expect 500 false positives. Early biomedical papers calling "significant" anything with raw p < 0.05 is a major driver of the reproducibility crisis.
Multiple testing splits into two philosophies: (1) FWER (Family-Wise Error Rate) — probability of ≥1 false positive; Bonferroni, Holm. Conservative, suited to confirmatory tests. (2) FDR (False Discovery Rate) — expected fraction of false positives among significant calls; Benjamini-Hochberg (1995) and Storey q-value (2003). Higher power; the omics standard.
一、校正方法一覽表
| 方法 | 控制 | 保守度 | 使用場景 |
|---|---|---|---|
| Bonferroni | FWER | 極保守 | 少量驗證 |
| Holm (1979) | FWER | 較 Bonferroni 強 | 任何 FWER 場景 |
| BH (1995) | FDR | 平衡 | 組學分析 |
| Storey q-value | FDR | 較 BH 寬 | 大量檢定 |
| Tukey HSD | FWER | ANOVA 後 | 所有兩兩 |
| Dunnett's | FWER | 對照組比較 | vs 對照 |
校正方法的對比視覺化
調整真陽性比例與 α,觀察 Bonferroni、BH、q-value 篩出的「顯著」基因數差異。關鍵:BH 給你更多顯著結果,但允許 5% 是假陽性。
Adjust true-positive proportion and α. See how Bonferroni, BH, q-value differ in hit count. Key: BH yields more hits but accepts ~5% false positives.
二、套用校正
# Base R: p.adjust 多種方法 p_raw <- c(0.001, 0.01, 0.02, 0.03, 0.04, 0.5) p.adjust(p_raw, method="bonferroni") p.adjust(p_raw, method="holm") p.adjust(p_raw, method="BH") # Benjamini-Hochberg p.adjust(p_raw, method="BY") # Benjamini-Yekutieli (depnedent tests) # Storey q-value(Bioconductor) library(qvalue) qobj <- qvalue(p=p_raw) qobj$qvalues # q-values(FDR 控制) qobj$pi0 # 估算 π₀(真 null 比例) # ANOVA 後 Tukey HSD / Dunnett's fit <- aov(value ~ group, data=df) TukeyHSD(fit) library(multcomp) summary(glht(fit, linfct=mcp(group="Dunnett")))
from statsmodels.stats.multitest import multipletests import numpy as np p_raw = np.array([0.001, 0.01, 0.02, 0.03, 0.04, 0.5]) multipletests(p_raw, method="bonferroni") multipletests(p_raw, method="holm") multipletests(p_raw, method="fdr_bh") # BH multipletests(p_raw, method="fdr_by") # BY # Storey q-value 透過 multipy 或 rpy2 from multipy.fdr import qvalue significant, q = qvalue(p_raw, threshold=0.05) # Tukey HSD via pingouin import pingouin as pg print(pg.pairwise_tukey(data=df, dv="value", between="group"))
三、最常見的錯誤
❌ 把 q 值講成 p 值
「q=0.03 顯著」與「p=0.03 顯著」意義不同:q 控制比例(5% 顯著結果是假陽性),p 控制單次錯誤。要明確標示。
"q=0.03 significant" ≠ "p=0.03 significant": q controls proportion (5% of hits are false), p controls per-test error. Label explicitly.
❌ 先篩 DEG 再校正 GO
先以 BH 篩 DEG (FDR<0.05) → 再對 GO terms 跑 BH,二次校正會破壞統計獨立性假設。應正確使用 enrichGO 等預先設計的工具。
Selecting DEGs at FDR<0.05 then re-applying BH on GO breaks independence. Use enrichGO-style tools designed for this.
❌ 基因 vs 轉錄本 FDR
同一基因多個轉錄本各自檢定 → FDR 顯著數量會被「拆細」放大。tximport 應 collapse 至 gene-level 再 DESeq2。
Multiple transcripts per gene split FDR inflation. Use tximport to collapse to gene-level before DESeq2.
❌ 二次決策不校正
從 100 個 hit 中再挑 10 個做機制驗證 = pre-selection bias,後續顯著率仍有膨脹。整個 pipeline 須一致記錄。
Picking 10 of 100 hits for follow-up = pre-selection bias inflates the final α. Pre-register the full pipeline.
🎯 章末小測驗
1. 組學 DE 分析最常用校正?
2. Bonferroni vs BH 差別?
3. 多組 vs 同對照?