Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p-values in the output plot is on negative natural log scale? #55

Open
ruthchia opened this issue Apr 10, 2023 · 2 comments
Open

p-values in the output plot is on negative natural log scale? #55

ruthchia opened this issue Apr 10, 2023 · 2 comments

Comments

@ruthchia
Copy link

Hi,
I wanted to check if the -log10(P) values included in the focus plot are on the log10 or natural log scale.
I did some conversions of the Z-scores and noticed that it did not match up when I recalculated it in R.

For example, for a Z-score value of 4.5800, the FOCUS outputted -log10(P) in the plot was 12.27869 .
When I calculated in R (see below), I got a different value. Can you please help clarify? Did I miss something that resulted in my calculations being incorrect?

Thanks,
Ruth

> Z = 4.5800
> P = 2*pnorm(abs(Z), lower.tail = FALSE) # convert Z-score to P-values
> P
[1] 4.649759e-06
> -log10(P). # convert P-values to -log10(P)
[1] 5.33257
@quattro
Copy link
Contributor

quattro commented Apr 10, 2023

Hi Ruth,

Yes good catch. It looks like it is still in natural log, and not log10. For example,

> Z = 4.5800
> 2*pnorm(abs(Z), lower.tail = FALSE)
[1] 4.649759e-06
> pnorm(abs(Z), lower.tail = FALSE, log.p=TRUE) + log(2)  # log(2 * p)
[1] -12.2787

@ruthchia
Copy link
Author

Great - thanks for your quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants