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.ma...@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 <jorism...@gmail.com>
>
> # not tested
>> out <- rbind(as.numeric(Wnew),as.numeric(P))
>> rownames(out) <- c("Wnew","P")
>>
>>
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to