Repository navigation
ENH: Add Dunn's multiple comparison test after Kruskal-Wallis (closes #852) - #10251
Open
Shikhar-Kesharwani wants to merge 2 commits into
Open
Shikhar-Kesharwani wants to merge 2 commits into
Shikhar-Kesharwani wants to merge 2 commits into
Conversation
…tatsmodels#852) - Implements dunn_test() function and DunnResult class in statsmodels.stats.nonparametric - Re-exports dunn_test in statsmodels.stats.api - Supports pooled and unpooled variance formulations, full tie corrections, and multipletests multiplicity adjustments - Validated against R's dunn.test package with and without ties Signed-off-by: Shikhar Kesharwani <[email protected]>
This was referenced Sep 13, 2026
Member
|
Some comments before this can be merged:
|
bashtage
requested changes
Oct 6, 2026
bashtage
left a comment
Member
There was a problem hiding this comment.
Please address this list of issues in the main comment section.
Member
|
Also, make sure the docstring fully follows the docstring conventions in AGENTS. |
- Validate alternative and p_adjust with string_like - Support 2D numpy ndarrays as input - Handle NaNs gracefully with descriptive ValueError - Document R dunn.test provenance in tests - Clarify standard pooled variance formulation in docstring Notes - Format docstrings per AGENTS.md conventions - Add dunn_test and DunnResult to docs/source/stats.rst
Author
|
Hi @bashtage, Thank you for the thorough review and guidance. I have pushed commit
Please let me know if any further adjustments are needed! |
bashtage
approved these changes
Nov 18, 2026
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.
NumPy's guide.
AI Disclosure
Contributions must comply with the statsmodels AI Policy.
Please complete one of the following:
Tool(s): Claude.
Used for: drafting an implementation, writing tests, and editing docstrings.
I have personally read, understood, and can explain every line of this diff, and
have verified the statistical/numerical correctness of the change.
Summary & Motivation
This PR implements
dunn_test()instatsmodels.stats.nonparametric(and re-exported instatsmodels.stats.api), resolving #852.Key features:
multipletests(Bonferroni, Holm, Benjamini-Hochberg FDR, etc.).*args, or DataFrame withval_colandgroup_col.DunnResultcontainer with.comparisons,.z_scores,.pvalues,.reject,.statistic_table, and formatted.summary().dunn.testpackage with and without ties.TestDunnTestwith 7 passing unit tests instatsmodels/stats/tests/test_nonparametric.py.