我为我的数据做了一个嵌套方差分析。为此,我尝试定位此页面上的示例:
https://rcompanion.org/rcompanion/d_07.html
我的数据如下所示:
Treatment Group Donation
1 1 0
1 1 1.2
1 2 0.3
1 2 0.7
2 1 0.1
2 1 1
2 2 0
2 2 0.7
我能够按照页面上的描述执行嵌套方差分析,但很难完成事后测试:
library(multcomp)
posthoc = glht(model,
linfct = mcp(Treatment="Tukey"))
mcs = summary(posthoc,
test=adjusted("single-step"))
mcs
这是我得到的输出:
> library(multcomp)
> posthoc = glht(model,
+ linfct = mcp(Treatment="Tukey"))
Error in `[.data.frame`(mf, nhypo[checknm]) : undefined columns selected
> mcs = summary(posthoc,
+ test=adjusted("single-step"))
Error in summary(posthoc, test = adjusted("single-step")) :
object 'posthoc' not found
> mcs
Error: object 'mcs' not found