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

Bonferroni Correction #52

Open
jonathan-bravo opened this issue Mar 9, 2022 · 2 comments
Open

Bonferroni Correction #52

jonathan-bravo opened this issue Mar 9, 2022 · 2 comments

Comments

@jonathan-bravo
Copy link

def correct_pvalues(count_table):
num_tests = len(count_table)
for row in count_table:
row["bonf_pvalue"] = min(row["pvalue"] * num_tests, 1.0)

From what I am reading the Bonferroni correction is the pvalue divided by the number of tests, but in the above function it looks like the pvalue is being multiplied by the number of tests. In my use case this is leading to all the bonf_pvalue(s) to default to a minimum value of 1.0...

Please let me know if I am understanding something incorrectly.

Cheers,
Johnny

@jingydz
Copy link

jingydz commented Aug 7, 2024

I have found that you are correct, so we should use the p-values instead of the Bonferroni-corrected p-values, right?

@jonathan-bravo
Copy link
Author

If it were me, yes I would just use the p-values. Maybe you can output the number of tests and then generate the value yourself because when I attempted to correct the code I was getting nil values returned.

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