[R] wilcoxon test with bonferroni correction

Chuck Cleland ccleland at optonline.net
Mon Feb 2 10:59:11 CET 2009


On 2/1/2009 8:32 PM, Laura Lucia Prieto Godino wrote:
> Hi!
> I need to run a wilcoxon (Mann-whitly, in fact) test with bonferroni
> correction, as I am running 10 consecutive wilcoxon test not
> independent, and I know that bonferroni will partially correct for this
> problem, but I have no idea how to do it with R, I have been looking in
> the archive but couldn't understand how to do it.
> 
> The format I am using at the moment is
> 
> r4_o <-
> 
>  [1] 1.05 2.60 1.57 3.07 1.20 1.00 2.11 1.10 0.10
> 
> r4_m <-
> 
> [1] 0 0 0 0 0 0 0 0 0
> 
> wilcoxon.test (r4_o, r3_m)
> 
> Does any body know how to make the bonferroni correction when I compare
> them with the wilcoxon test?

# Ten p-values

> X <- seq(.001, .10, len=10)

> X
 [1] 0.001 0.012 0.023 0.034 0.045 0.056 0.067 0.078 0.089 0.100

# Same ten p-values adjusted by the Bonferroni method

> p.adjust(X, method="bonferroni")
 [1] 0.01 0.12 0.23 0.34 0.45 0.56 0.67 0.78 0.89 1.00

?p.adjust

> Thank you very much.
> 
> Lucia 
> 
>  Lucia Prieto Godino
> PhD student.
> Department of Zoology,
> Downing street
> University of Cambridge.
> UK
> 
> ______________________________________________
> 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. 

-- 
Chuck Cleland, Ph.D.
NDRI, Inc. (www.ndri.org)
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894




More information about the R-help mailing list