简体   繁体   English

在R(WRS2包)中使用Wilcox强大ANOVA进行计划对比

[英]Planned contrasts using Wilcox robust ANOVA in R (WRS2 package)

I run a two-way ANOVA and a posthoc tests on my dataset using WRS2. 我使用WRS2在我的数据集上运行双向ANOVA和posthoc测试。 Yet within the contrasts I do not find the comparisons I need. 然而在对比中,我找不到我需要的比较。 Is it possible to plan my own contrasts? 是否可以规划自己的对比?

Unfortunately, it looks like the contrasts are hard-coded in the mcp2atm function. 不幸的是,看起来对比在mcp2atm函数中是硬编码的。 Some excerpts from the guts of that function (which you can see by typing mcp2atm at the command prompt: you can also dump() the function to an external file). 一些来自该函数内容的摘录(您可以通过在命令提示符下键入mcp2atm来查看:您还可以将函数dump() mcp2atm到外部文件)。

...
temp <- con2way(J, K)
conA <- temp$conA
conB <- temp$conB
conAB <- temp$conAB
if (!op) {  ## note: op is hardcoded to FALSE earlier in the function
    Factor.A <- lincon1(x, con = conA, tr = tr, alpha = alpha)
    Factor.B <- lincon1(x, con = conB, tr = tr, alpha = alpha)
    Factor.AB <- lincon1(x, con = conAB, tr = tr, alpha = alpha)
}
## ... stuff for generating contrast names ...
contrasts <- as.data.frame(cbind(conA, conB, conAB))
colnames(contrasts) <- c(dnamesA, dnamesB, dnamesAB)
rownames(contrasts) <- colnames(dataWide)
...

con2way and lincon1 are internal WRS2 functions (you can see them using WRS2::con2way and WRS2:::lincon1 ). con2waylincon1是内部WRS2函数(你可以使用WRS2::con2wayWRS2:::lincon1看到它们)。 (If you really want to dig into the source code it probably makes sense to download the source package and unpack it.) (如果你真的想深入研究源代码,下载源代码包并解压缩它可能是有意义的。)

To do custom contrasts you would probably have to take it up with the maintainer of WRS2 ( maintainer("WRS2") , or possibly try the issues tracker on R-forge ...) I don't know whether any of the other robust stats machinery (see the robust stats task view ) would provide an alternative route ... 要进行自定义对比,您可能需要与WRS2maintainer("WRS2") ,或者可能尝试使用R- maintainer("WRS2")问题跟踪器 ...)我不知道是否还有其他任何强大的统计机器(参见强大的统计任务视图 )将提供替代路线......

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

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