Add brunner_munzel(): nonparametric test for stochastic equality (Brunner & Munzel 2000)#515
Open
hass-nation wants to merge 1 commit into
Open
Add brunner_munzel(): nonparametric test for stochastic equality (Brunner & Munzel 2000)#515hass-nation wants to merge 1 commit into
hass-nation wants to merge 1 commit into
Conversation
Implements the Brunner-Munzel test for stochastic equality of two independent groups, with Welch-Satterthwaite degrees of freedom, CLES and RBC effect sizes, and full nan_policy support. Adds 11 tests covering basic accuracy vs scipy, one-sided alternatives, NaN handling, effect size range, and column schema. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #515 +/- ##
==========================================
- Coverage 98.36% 98.26% -0.10%
==========================================
Files 19 19
Lines 3305 3351 +46
Branches 488 495 +7
==========================================
+ Hits 3251 3293 +42
- Misses 32 34 +2
- Partials 22 24 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Owner
|
Hi, Thanks for opening the PR. Brunner Munzel is already supported by scipy.stats, so I don't see a strong reason to add it to Pingouin (I'm not sure what the value add would be), unless others feel strongly about it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
brunner_munzel(x, y)— the Brunner-Munzel test, a nonparametric test for stochastic equality of two independent groups. It is more robust than the Wilcoxon rank-sum / Mann-Whitney U test under heteroscedasticity (unequal variances), which is its main practical advantage.Algorithm
Uses a Welch-Satterthwaite degrees-of-freedom approximation and a t-distribution reference. The test statistic is based on within-group and between-group rank differences. p-values are verified to match
scipy.stats.brunnermunzel.Interface
New content
brunner_munzel()function added topingouin/nonparametric.pyand exported frompingouin/__init__.pytests/test_nonparametric.pycovering: basic correctness vs scipy, identical groups, clear-difference groups, one-sided alternatives, effect size bounds, all threenan_policymodes, output column namesReference
Brunner, E. & Munzel, U. (2000). The nonparametric Behrens-Fisher problem: asymptotic theory and a small-sample approximation. Biometrical Journal, 42(1), 17–25.