This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How can I convert -log10 (p-value) to p-value?

If log(10)p = 20, what is p?

The threshold is p≤ 10-8

meta analysis gwas

10*20 = p (assuming 10 is the log base)

1 answer

Hi, the main text of your question contradicts what you have written in the title of the question. The answer provided in the comment of fracarb8, therefore, is also misleading.

It can be assumed that you want to transform a vector of p-values from -log10(p) to p. This can be achieved by the following, here shown with proof:

# create vector of p-values
p <- c(0.0001, 0.56, 0.04, 0.99, 10e-16)

# transform via -log10 (negative log base 10)
-log10(p)
[1]  4.000000000  0.251811973  1.397940009  0.004364805 15.000000000

# transform back to p-values
1 / (10^-log10(p))
[1] 0.0001 0.56 0.04 0.99 0.000000000000001

. , or, simplified:

p <- c(0.0001, 0.56, 0.04, 0.99, 10e-16)
p2 <- -log10(p)
1 / (10^p2)
[1] 0.0001 0.56 0.04 0.99 0.000000000000001

.

Thus, the answer in English text, is:

one divided by 10 to the power of the negative log base 10 of the p-value

Kind regards,

Kevin

Log in to answer this question.