Re: [R] Wilcoxon test output as a table

From: Iurie Malai <iurie.malai_at_gmail.com>
Date: Sun, 06 Jun 2010 01:05:18 +0300

Sorry, Joris, now is wonderful! Thank you!

Now, this is the code:

W <- as.matrix(lapply(Dataset[2:11], function(x) wilcox.test(x ~ GrFac, alternative="two.sided", data=Dataset)$statistic)) P <- as.matrix(lapply(Dataset[2:11], function(x) wilcox.test(x ~ GrFac,

alternative="two.sided", data=Dataset)$p.value))
W <- format(W, digits = 5, nsmall = 2)
P <- format(P, digits = 1, nsmall = 3)

out <- rbind(as.numeric(W),as.numeric(P)) rownames(out) <- c("W", "P")
colnames(out) <- paste(colnames(Dataset[2:11])) out

This is the output:

       X1     X2       X3       X4        X5       X6       X7
X8       IA       IV

W 4582.500 4335.5 4610.500 4008.500 6409.5000 6064.500 5126.500 6.8615e+03 4305.500 5769.000
P 0.301 0.1 0.336 0.013 0.0005 0.008 0.756 4.0000e-06 0.089 0.059

I am happy!

2010/6/6 Iurie Malai <iurie.malai_at_gmail.com>

> Thank you, Joris!
>
> I received two identical warnings:
>
> [14] WARNING: Warning in if (nchar(cmd) <= width) return(cmd) :
> the condition has length > 1 and only the first element will be used
> [15] WARNING: Warning in if (nchar(cmd) <= width) return(cmd) :
> the condition has length > 1 and only the first element will be used
>
> 2010/6/6 Joris Meys <jorismeys_at_gmail.com>
>
> # not tested
>> out <- rbind(as.numeric(Wnew),as.numeric(P))
>> rownames(out) <- c("Wnew","P")
>>
>>
>

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat 05 Jun 2010 - 22:08:12 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 05 Jun 2010 - 22:10:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive