Skip to content

validate proportion inputs in proportion_difference - #1185

Merged
rasbt merged 5 commits into
rasbt:masterfrom
Qayad-Ali:validate-proportion-difference-inputs
Aug 5, 2026
Merged

validate proportion inputs in proportion_difference#1185
rasbt merged 5 commits into
rasbt:masterfrom
Qayad-Ali:validate-proportion-difference-inputs

Conversation

@Qayad-Ali

Copy link
Copy Markdown
Contributor

proportion_difference silenlty returned (nan, nan) (with a RuntimeWarning) when a proportion was outside [0, 1], for e.g. proportion_difference(1.5, 0.3, 50). This adds validation that raises a clear ValueError when proportion_1 or proportion_2 is not in [0, 1] — consistent with the input checks already in mcnemar and cochrans_q. Valid-input behavior is unchanged; a unit test was added.

@rasbt rasbt left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the PR

@rasbt
rasbt merged commit 9aadcee into rasbt:master Aug 5, 2026
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants