[Rd] Feature request: adding a log.p= option to stats::p.adjust?

Aaron Lun |n||n|te@monkey@@w|th@keybo@rd@ @end|ng |rom gm@||@com
Mon Dec 14 04:10:39 CET 2020

Dear list,

Is there any interest in adding a log.p= option to p.adjust() so that it 
can accept log-transformed p-values and return log-transformed adjusted 

I have some functions that, on occasion, return very low p-values. To 
avoid underflow in such cases, I allow my users to set log.p=TRUE, which 
is passed onto pt(), pchisq(), etc. to return log-transformed p-values. 
However, currently, these log-p-values need to be run through exp() 
before being used in p.adjust(). This re-introduces the possibility of 
underflow errors, sometimes leading to adjusted p-values of zero.

The proposed log.p= mode for p.adjust() would perform all operations in 
the log-scale to avoid this - see 
for an example with the BH correction. If it were available, we could 
conveniently pass along the log.p=TRUE option to p.adjust() as we do for 
pt() and friends, and everything would "just work".

If this sounds sensible, I would be happy to put a patch together; the 
modifications involved seem simple enough.



More information about the R-devel mailing list