-
Notifications
You must be signed in to change notification settings - Fork 58
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
Fix the two sided test on IBMA Fishers and Stouffers estimators #903
Conversation
Reviewer's Guide by SourceryThis pull request fixes the implementation of two-sided tests for Fisher's and Stouffer's estimators in the IBMA (Image-Based Meta-Analysis) module. The changes modify how z-scores and p-values are calculated to properly handle both positive and negative tails in two-sided tests. File-Level Changes
Tips
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @JulioAPeraza - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding explanatory comments for the two-sided test implementation to improve code readability and maintainability.
- To reduce code duplication, consider extracting the common logic for positive and negative tails into a separate function.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
est = pymare.estimators.FisherCombinationTest(mode=self._mode) | ||
est.fit_dataset(pymare_dset) | ||
est_summary = est.summary() | ||
# Run Stouffers for right tail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (performance): Consider performance implications of running two separate tests for two-sided cases
The new implementation runs two separate tests when two_sided is True, which could potentially double the computation time. Consider if there's a way to optimize this, especially for large datasets.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #903 +/- ##
==========================================
+ Coverage 88.23% 88.25% +0.02%
==========================================
Files 48 48
Lines 6382 6394 +12
==========================================
+ Hits 5631 5643 +12
Misses 751 751 ☔ View full report in Codecov by Sentry. |
@jdkent I checked the examples gallery, and the results look good now: https://nimare--903.org.readthedocs.build/en/903/auto_examples/02_meta-analyses/02_plot_ibma.html#sphx-glr-auto-examples-02-meta-analyses-02-plot-ibma-py |
I'm making a pull request here to fix the underlying bug in pymare: neurostuff/PyMARE#125 |
Thanks! Closing this in favor of #904. |
Closes None.
Changes proposed in this pull request:
Summary by Sourcery
Fix the two-sided test implementation for IBMA Fishers and Stouffers estimators by running separate tests for each tail and using the minimum p-value to ensure correct handling of both tails.
Bug Fixes: