Inverse of -log(p)
1
3
Entering edit mode
2.4 years ago

I've got some data with p values expressed as -log(p). How do I invert this to the p values?

I've read here about undoing -log10(p):

How can I convert -log10 (p-value) to p-value?

p <- 0.01
logp <- -log10(p)
10^-logp

Here are some example -log(p) in the table:

1.542108761
1.760644949
1.567865477
1.779197974

Is it:

exp(1)^(-logp)

Thanks!

r statistics log-p • 1.7k views
ADD COMMENT
2
Entering edit mode

Hi Michael,

The correct transformation would be: 1/exp( )

The proof:

p=0.05
result <- -log(p)
1/exp(result)
[1] 0.05

p=0.0034
result <- -log(p)
1/exp(result)
[1] 0.0034

p=0.0000023
result <- -log(p)
1/exp(result)
[1] 2.3e-06
options(scipen=999)
1/exp(result)
[1] 0.0000023

Kind regards / Cordiali saluti,
Kevin

ADD REPLY
0
Entering edit mode

Moved back to comment, as I had interpreted that the log transformation under question was natural log (log e).

ADD REPLY
3
Entering edit mode
2.4 years ago
Jeremy ▴ 930

In base 10, it should be:

1/(10^num1)

From example:

p = .05
num1 = -log10(p)
1/(10^num1)
[1] 0.05
ADD COMMENT
1
Entering edit mode

Thank you Sir. Indeed, it is log base 10.

ADD REPLY

Login before adding your answer.

Traffic: 1798 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