0

After running EWAS adjustment using the R package BACON, and extracting the p-values from the resulting object, I am finding that many of my results have P-values of 0 (literally 0 rather than a very small number that is being truncated). After some testing, it appears related to how P-values are extracted by bacon:

function (object, corrected = TRUE) 
{
    if (!corrected | any(is.na(bias(object))) | any(is.na(inflation(object)))) 
        pvalues <- 2 * pnorm(-abs(object@teststatistics))
    else {
        teststatistics <- t(t(object@teststatistics) - bias(object))
        teststatistics <- t(t(teststatistics)/inflation(object))
        pvalues <- 2 * pnorm(-abs(teststatistics), mean = 0, 
            sd = 1, lower.tail = TRUE, log.p = FALSE)
    }
    return(pvalues)
}

If a test statistic is small enough (around -37.5 from what I have tested), the pnorm() function returns 0. See my example:

> pnorm(-abs(-37.51925))
[1] 2.235906e-308
> pnorm(-abs(-38.51925))
[1] 0

This obviously can cause issues. How could I fix this?

Thank you.

  • https://stackoverflow.com/questions/62904917/how-can-i-extract-extremely-small-p-values-from-coxph-without-it-rounding-to-0/62905259#62905259 https://stackoverflow.com/questions/46416027/how-to-compute-p-values-from-z-scores-in-r-when-the-z-score-is-large-pvalue-muc/46416222#46416222 https://stackoverflow.com/questions/41260910/lmer-output-very-low-p-values/41273460#41273460 – Ben Bolker Oct 05 '22 at 15:40
  • 1
    Try setting `log.p = TRUE` to return a log-transformed p-value. Your issue comes from float [underflow](https://en.wikipedia.org/wiki/Arithmetic_underflow) – Anil Oct 05 '22 at 15:42

0 Answers0