Dear Renato,
I've never used this package and you did not attached a reproducible
example, so I cannot test my suggestion. Nevertheless, please try
converting the column "i" to factor before calling the t2way() and
mcp2atm() functions, and replace "as.factor(i)" with "i" in the model
formulas:
khg$i <- as.factor(khg$i)
t2way(formula = fr ~ t * i, data = khg)
mcp2atm(fr ~ t * i, data = khg)
Since you read the khg.txt file with stringsAsFactors = TRUE
parameterization, the factor conversion can be skipped if "i" contained
text. If it contained numbers, then the conversion is needed.
HTH,
Ákos
______________
Ákos Bede-Fazekas
Centre for Ecological Research, Hungary
2024. 07. 27. 0:23 keltezéssel, Renato Filogonio írta:
Dear list,
I used a robust two-way ANOVA using the WRS2 package (R v.4.4.1), using the
following code as suggested by Mair and Wilcox (2020)
library(WRS2)
khg<-read.table("khg.txt", h = T, dec = ".", sep = "\t",
stringsAsFactors=T, na.strings = "NA")
t2way(fr ~ t * as.factor(i), data = khg)
This worked fine, so it returned:
Call:
t2way(formula = fr ~ t * as.factor(i), data = khg)
value p.value
t 133.0420 0.001
as.factor(i) 3317.8926 0.001
t:as.factor(i) 150.6804 0.001
When I run the pairwise comparison using mcp2atm(), I get:
mcp2atm(fr ~ t * as.factor(i), data = khg)
Error in `[.data.frame`(data, variable.names(mf)) :
undefined columns selected
So, it is basically the same code for the same dataframe but another
function from the same package, but now I get an error message. I tried to
look at the pairwiseRobustTest() function from the package 'rcompanion' but
it is now [Defunct!] as in the last version of 'rcompanion', so I am afraid
I am running out of options... Any thoughts on how to circumvent this
problem?
I have posted the dataset here:
https://stackoverflow.com/questions/78800048/error-using-mcp2atm-function-for-robust-pairwise-comparisons-undefined-columns
Thanks in advance!
Renato
*Renato Filogonio*
http://lattes.cnpq.br/0339937732653268
[[alternative HTML version deleted]]
_______________________________________________
R-sig-ecology mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
_______________________________________________
R-sig-ecology mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology