-
Notifications
You must be signed in to change notification settings - Fork 56
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
module-traitRelationships negative correlation p values incorrect #73
Comments
Hi, Thanks for using PyWGCNA, would you mind telling me the approach you used? On my side, I used scipy.stats.pearsonr with alternative='greater', so I would assume your observation it because you probably go with the alternative='two-sided'. I'm happy to change the alternative parameter if that's the problem here |
Hello,
Ah I think that’s the issue! Yeah I used the default for the Pearson r
test, which happens to be the two sided. I can check later tonight or
tomorrow if I can recreate the issue but I think it’s like you said. Could
you change the alternative parameter to two-sided or make it an option?
Thanks,
Richard
…On Fri, Oct 27, 2023 at 13:50 Narges Rezaie ***@***.***> wrote:
Hi,
Thanks for using PyWGCNA, would you mind telling me the approach you used?
On my side, I used scipy.stats.pearsonr
<https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.pearsonr.html>
with alternative='greater', so I would assume your observation it because
you probably go with the alternative='two-sided'.
I'm happy to change the alternative parameter if that's the problem here
—
Reply to this email directly, view it on GitHub
<#73 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHBOUAGEUWLTDW6LJZKVN23YBQM73AVCNFSM6AAAAAA6TJO5GGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBTGQ4TOMBRGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
sure happy to change it and make it an option in the next release. Will close this issue once I make a new release. |
Hello,
There is an issue with p value calculation for negative correlations in the module-trait relationship. For example, if I calculate the correlation A vs. B, the results are R=0.7 p <0.01. When I use the same data but now make the trait B vs. A, the results are R =-0.7 p = 0.99. The p-value is always 1-p of the opposite comparison. I tested this myself by extracting the eigenvalues for each of my samples for a module and switched the order of comparison. I reproduced the correlation for both comparisons but only the p value for the correlation. The p value for the negative correlation in my test, was as significant as the positive correlation, which is to be expected.
Hoping you could look into this! May be a very quick fix.
The text was updated successfully, but these errors were encountered: