如何解释 R 中的 TukeyHSD 输出? (关于基础回归模型)

How do I interpret the TukeyHSD output in R? (in relation to the underlying regression model)

我建立了一个简单的线性回归模型,其中 'Score' 作为因变量,'Activity' 作为自变量。 'Activity'有5个级别:'listen'(参考级别)、'read1'、'read2'、'watch1'、'watch2'。

Call:
lm(formula = Score ~ Activity)

Residuals:
     Min       1Q   Median       3Q      Max 
-22.6154  -8.6154  -0.6154   7.1346  31.3846 

Coefficients:
               Estimate Std. Error t value Pr(>|t|)    
(Intercept)      41.615      2.553  16.302   <2e-16 ***
Activityread1     6.385      7.937   0.804   0.4254    
Activityread2    20.885      9.552   2.186   0.0340 *  
Activitywatch1    3.885      4.315   0.900   0.3728    
Activitywatch2  -11.415      6.357  -1.796   0.0792 .  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 13.02 on 45 degrees of freedom
Multiple R-squared:  0.1901,    Adjusted R-squared:  0.1181 
F-statistic:  2.64 on 4 and 45 DF,  p-value: 0.04594

为了获得所有成对比较,我执行了 TukeyHSD 测试,我很难解释其输出。虽然模型的输出显示我们唯一的显着影响是由于 'listen' 和 'read2' 之间的对比,但 TukeyHSD 结果表明 'watch2' 和 'watch2' 之间存在唯一显着的对比=27=]。这是什么意思?

> TukeyHSD(aov(mod4), "Activity")
  Tukey multiple comparisons of means
    95% family-wise confidence level

Fit: aov(formula = mod4)

$Activity
                    diff        lwr       upr     p adj
read1-listen    6.384615 -16.168371 28.937602 0.9279144
read2-listen   20.884615  -6.256626 48.025857 0.2034549
watch1-listen   3.884615  -8.376548 16.145779 0.8952957
watch2-listen -11.415385 -29.477206  6.646437 0.3885969
read2-read1    14.500000 -19.264610 48.264610 0.7397464
watch1-read1   -2.500000 -26.031639 21.031639 0.9981234
watch2-read1  -17.800000 -44.811688  9.211688 0.3466391
watch1-read2  -17.000000 -44.959754 10.959754 0.4278714
watch2-read2  -32.300000 -63.245777 -1.354223 0.0368820
watch2-watch1 -15.300000 -34.569930  3.969930 0.1783961

在您的初始模型摘要中,Estimate 显示了每个组相对于 "listen" 组 (40.615) 的平均值的估计差异。当仅计算这 4 个比较时,"read2" 组与 "listen" 组的偏移量最大 (+20.885) 被称为显着 p = .0340

由于 TUKEYHSD 正在对组均值执行所有成对比较(不再只是参考水平 "listen"),它还会执行 p 值调整以说明所有这些额外测试.原因是,如果您对随机数据进行 20 次比较,您会期望一次(1/20 或 .05)被称为具有 p < .05 的显着性,仅仅是因为进行了那么多测试。考虑到 p 值调整后,"listen - read2" 之间最初的显着比较不再具有显着性。

但是 "watch2 - read2" (-32.3) 之间的较大差异未在原始模型摘要中进行测试,即使在完成所有额外的比较调整。

希望对您有所帮助,您可以阅读有关多重比较问题的更多信息here .并查看 ?p.adjust 以了解 R 对最流行方法的实现。