How can I convert -log10 (p-value) to p-value?
1
0
Entering edit mode
2.1 years ago
ymberzal • 0

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

The threshold is p≤ 10-8

meta analysis GWAS • 1.5k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode
2.1 years ago

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

ADD COMMENT
0
Entering edit mode

Thanks a lot! I got it!

ADD REPLY

Login before adding your answer.

Traffic: 1182 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6