Skip to content

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

Open
@tomasdominik

Description

@tomasdominik

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?

Metadata

Metadata

Assignees

Labels

bug 💥Something isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions