- 定义
双边检验(two-tailed test):检测两个样本之间是否有差异,不管谁大谁小。更常用、更保守,用于你不知道或不关心方向时
单边检验(one-tailed test):检测某一方向上的差异,比如是否增加或是否减少。更敏感(因为显著性阈值集中在一侧),但需有明确方向假设。
- R语言中的参数
单边检验
alternative = "greater" 假设组2 > 组1(OE > CK)
alternative = "less" 假设组2 < 组1(OE < CK)双边检验
alternative = "two.sided" 双边检验(默认)- 比较
检验类型 | 方向性 | 更保守 | 适用场景 | R参数 |
双边检验 | 无 | ✅ | 不知道方向;初步研究 |
|
单边检验 | 有 | ❌ | 已有明确方向假设 |
|
ggplot(df, aes(x = Group, y = Value, fill = Group)) +
geom_boxplot(width = 0.5, outlier.shape = 21, outlier.fill = "red") +
geom_jitter(width = 0.1, size = 2, alpha = 0.7) +
stat_compare_means(
method = "t.test",
label = "p.signif",
comparisons = list(
c("12501_CK_1", "12501_OE_1"),
c("12501_CK_2", "12501_OE_2"),
c("12501_CK_3", "12501_OE_3")
),
alternative = "greater" # 单边检验(OE > CK)
) +
labs(title = "qPCR Expression Analysis",
x = "Group",
y = expression(2^{-Delta*Delta*Ct})) +
theme_classic() +
theme(
axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)
)
原文链接:单边检验和双边检验