简体   繁体   中英

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. 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. 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).

...
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 ). (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 ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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