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

pg.bayesfactor_pearson(r=-0.856, n=64, alternative="greater") returns wrong BF value #427

Open
tomasdominik opened this issue Jun 20, 2024 · 0 comments
Assignees
Labels
bug 💥 Something isn't working

Comments

@tomasdominik
Copy link

tomasdominik commented Jun 20, 2024

I have two sets of paired data (n=64). Person correlation between the sets is -0.856 (precise value -0.856341390601075). Using pg.bayesfactor_pearson(r=-0.856, n=64, alternative="two-sided"), I receive correct Bayes factor of ~2.7309e+16 (checked with JASP 0.17).

Using pg.bayesfactor_pearson(r=-0.856, n=64, alternative="less"), I receive Bayes factor of ~5.4617e+16, which also corresponds with JASP.

However, pg.bayesfactor_pearson(r=-0.856, n=64, alternative="greater") returns Bayes factor of 976, which is incorrect (JASP shows 1e-317). It also obviously cannot be the right answer either way, because the correlation is negative, and so one-tailed correlation test assuming positive correlation cannot show evidence for the alternative.

Is this a bug in pingouin or is this a case of float underflow due to the miniscule size of the correct BF?

@raphaelvallat raphaelvallat self-assigned this Jun 22, 2024
@raphaelvallat raphaelvallat added the bug 💥 Something isn't working label Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 💥 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants