简体   繁体   English

无法在互动中执行Tukey的HSD测试

[英]Unable to perform Tukey's HSD test on interaction

I have a significant interaction and would like to perform a Tukey's HSD test on it, however, the examples I've found online don't seem to work for me. 我进行了一次重要的互动,并希望对此进行Tukey的HSD测试,但是,我在网上找到的示例似乎对我不起作用。

My data: 我的资料:

>dput(head(dataAvgSucCI))
structure(list(Collection = c(1L, 1L, 1L, 1L, 1L, 2L), Irrigation = 
structure(c(1L,2L, 3L, 4L, 5L, 1L), .Label = c("Rate1", "Rate2", "Rate3", "Rate4", 
"Rate5"), class = "factor"), meanSuc = c(0.585416666666667, 0.5032, 
0.61375, 0.602775, 0.688466666666667, 0.545133333333333), ab = 
structure(c(1L, 3L, 5L, 7L, 9L, 2L), .Label = c("1.Rate1", "2.Rate1", "1.Rate2", 
"2.Rate2", "1.Rate3", "2.Rate3", "1.Rate4", "2.Rate4", "1.Rate5", 
"2.Rate5"), class = "factor")), row.names = c(NA, -6L), class = c("grouped_df", 
"tbl_df", "tbl", "data.frame"), vars = "Collection", drop = TRUE, indices 
= list(0:4, 5L), group_sizes = c(5L, 1L), biggest_group_size = 5L, labels = 
structure(list(Collection = 1:2), row.names = c(NA, -2L), class = "data.frame", 
vars = "Collection", drop = TRUE)

What I am trying to do: 我正在尝试做的是:

require(multcomp) 
intSucCI <- with(dataAvgSucCI, interaction(Collection, Irrigation)) 
sucCIHSD.aov <- aov(meanSuc ~ Collection*Irrigation, data=dataAvgSucCI) 
summary(sucCIHSD.aov) 
sucCIHSD.glht <- glht(sucCIHSD.aov, linfct = mcp(intSucCI = "Tukey"))

Error code, occurs on last line of previous code: 错误代码,出现在先前代码的最后一行:

Error in mcp2matrix(model, linfct = linfct) : Variable(s) 'intSucCI' have been specified in 'linfct' but cannot be found in 'model'!` mcp2matrix(model,linfct = linfct)中的错误:在'linfct'中指定了变量'intSucCI',但在'model'中找不到!

Any help would be much appreciated. 任何帮助将非常感激。 Thank you! 谢谢!

Do you know the library TukeyC?. 您知道图书馆TukeyC吗?

library(TukeyC)
data(FE)

dad = FE$dfm

mod = aov(y ~ blk + N*P*K, dad)

#Studing K within N0 and P0.
tk = TukeyC(mod, which = 'N:P:K', fl1 = 1, fl2 = 1)
summary(tk)
plot(tk)

See help(TukeyC) to more details!




声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM