我正在使用R'multcomp'库(http://cran.r-project.org/web/packages/multcomp/)计算Dunnett的测试。我正在使用以下脚本:
Group <- factor(c("A","A","B","B","B","C","C","C","D","D","D","E","E","F","F","F"))
Value <- c(5,5.09901951359278,4.69041575982343,4.58257569495584,4.79583152331272,5,5.09901951359278,4.24264068711928,5.09901951359278,5.19615242270663,4.58257569495584,6.16441400296898,6.85565460040104,7.68114574786861,7.07106781186548,6.48074069840786)
data <- data.frame(Group, Value)
aov <- aov(Value ~ Group, data)
summary(glht(aov, linfct=mcp(Group="Dunnett")))
现在,如果我多次在R Console中运行此脚本,则每次得到的结果都会略有不同。这是一个例子:
Simultaneous Tests for General Linear Hypotheses
Multiple Comparisons of Means: Dunnett Contrasts
Fit: aov(formula = Value ~ Group, data = data)
Linear Hypotheses:
Estimate Std. Error t value Pr(>|t|)
B - A == 0 -0.35990 0.37009 -0.972 0.76545
C - A == 0 -0.26896 0.37009 -0.727 0.90019
D - A == 0 -0.09026 0.37009 -0.244 0.99894
E - A == 0 1.46052 0.40541 3.603 0.01710 *
F - A == 0 2.02814 0.37009 5.480 0.00104 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Adjusted p values reported -- single-step method)
这是另一个:
Simultaneous Tests for General Linear Hypotheses
Multiple Comparisons of Means: Dunnett Contrasts
Fit: aov(formula = Value ~ Group, data = data)
Linear Hypotheses:
Estimate Std. Error t value Pr(>|t|)
B - A == 0 -0.35990 0.37009 -0.972 0.7654
C - A == 0 -0.26896 0.37009 -0.727 0.9001
D - A == 0 -0.09026 0.37009 -0.244 0.9989
E - A == 0 1.46052 0.40541 3.603 0.0173 *
F - A == 0 2.02814 0.37009 5.480 <0.001 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Adjusted p values reported -- single-step method)
如您所见,以上两个结果略有不同,但是足以将最后一组(F)从两颗星移到三颗星,这让我感到担忧。
我对此有几个问题:
- 为什么会这样?当然,如果您每次都输入相同的数据,则应该得到相同的数据。
- Dunnett的计算中是否使用了某种随机数?
- 每次这种微小的变化实际上是一个问题吗?