[R] p.adjust on matrix of P-values from correlations
Muenchen, Robert A (Bob)
muenchen at utk.edu
Tue Nov 20 15:03:52 CET 2007
Hi All,
I'm stumped on something that must be trivial. I created a correlation
matrix on 4 variables (6 correlations) using Hmisc's rcorr function. I
wanted to correct the P-value matrix for the number of tests done, so I
ran it through the p.adjust function. That function adjusted for the 12
p-values it saw, rather than 6. I added the argument n=6 to p.adjust but
it requires that n be greater than the length of x. I guess its author
assumed you would always be correcting for more tests than it could see.
I changed the matrix into a long vector to see if that would matter. The
help file says it requires vector, but the result was the same.
If I were using the conservative Bonferroni correction, I could divide
the corrected P-values by 2 to make n=6 after the fact. However, I'm
using Holm's sequential method, so that's no good.
Any ideas?
Thanks,
Bob
P.S. I'm using R 2.6.0 Patched on Windows XP.
=========================================================
Bob Muenchen (pronounced Min'-chen),
Manager, Statistical Consulting Center
U of TN Office of Information Technology
Stokely Management Center, Suite 200
916 Volunteer Blvd., Knoxville, TN 37996-0520
Voice: (865) 974-5230
FAX: (865) 974-4810
Email: muenchen at utk.edu
Web: http://oit.utk.edu/scc
Map: http://www.utk.edu/maps
News: http://listserv.utk.edu/archives/statnews.html
=========================================================
More information about the R-help
mailing list