-
Notifications
You must be signed in to change notification settings - Fork 98
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
Bug in p-value calculations in adonis #120
Comments
jarioksa
pushed a commit
that referenced
this issue
Jun 12, 2015
adonis rounded permuted statistics, but did not round observed statistic before it was used, and tied values were not correctly recognized in assessing P-values. Reported as issue #120 in github by user fra-gh
Confirmed: this is a bug. Fixed in commit f727b58. Thanks for reporting this. |
thanks for the very prompt reply. keep up the good work! |
PR #136 has a better fix for this issue. |
Do we always need to calculate p-value separately or it goes automatically fixed? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The p-value calculated by adonis is sometimes wrong.
For example, the following code
returns
The p-value is wrong (only 24 permutations with high f instead of 39). The correct p-value can be computed from the definition to be
which correctly returns
It looks like the bug is due to rounding. When comparing f.perms and F.mod, the value of f.perms is rounded but the value of F.mod is not (although it is rounded afterwards). This makes the >= comparison fail in this example because the value of f.perms is rounded down.
The text was updated successfully, but these errors were encountered: