[R] test wilcoxon sur R help!

arun smartpink111 at yahoo.com
Thu Oct 24 21:16:00 CEST 2013


Hi,
Try:
fun1 <- function(dat){
mat1 <- combn(colnames(dat1),2)
 res <- sapply(seq_len(ncol(mat1)),function(i) {x1<- dat[,mat1[,i]]; wilcox.test(x1[,1],x1[,2])$p.value})
names(res) <- apply(mat1,2,paste,collapse="_")
res
}

set.seed(432)
dat1 <- as.data.frame(matrix(sample(18*10,18*10,replace=FALSE),ncol=18))

  fun1(dat1) #gives the p-value for each pair of columns




Hi, 

I want to make a wilcoxon test, i have 18 columns each column 
corresponds to a different sample and i want to compare one to each 
other with a wilcoxon test in one step this is possible ? or do i 
compare two by tow? 

Does it exist a code for automation this test? like this i dont have to type the code for each couple. 

thanks! 
denisse



More information about the R-help mailing list