Skip to content

Kruskal.test

1 message · arun

#
Hi,
You could try:
Chisq1<-do.call(cbind,lapply(c(0.05,0.001),function(i) {x1<-sapply(seq_len(nrow(Specc)),function(i) chisq.test(as.table(unlist(Specc[i,-c(1:3)])))$p.value); sum(x1<i)}))
?Wilcox1<-do.call(cbind,lapply(c(0.05,0.001),function(i){x1<-sapply(seq_len(nrow(Specc)),function(i) wilcox.test(unlist(Specc[i,-c(1:3)]))$p.value);sum(x1<i)}))

res<-rbind(Wilcox1,Chisq1)
?colnames(res)<- c("number of rows iwth p-value<0.05", "number of rows with p-value<0.001")
?rownames(res)<-c("wilcox.test","chisq.test")
? res
#??????????? number of rows iwth p-value<0.05 number of rows with p-value<0.001
#wilcox.test?????????????????????????????? 14???????????????????????????????? 0
#chisq.test???????????????????????????????? 0???????????????????????????????? 0


#The warnings() were there for all the rows.
#If you want, you could have a new column with "name of test", instead of rownames.

A.K.