Repository navigation
ENH: Add Brant test for proportional odds assumption in OrderedModel (closes #8442) - #10248
Shikhar-Kesharwani wants to merge 2 commits into
Conversation
|
Thanks, the AI Disclosure section looks complete. |
8692c4a to
5659791
Compare
| from statsmodels.discrete._diagnostics_ordered import ( | ||
| BrantResults, | ||
| brant_test, | ||
| ) |
|
@Shikhar-Kesharwani why you covered three issues, in single PR, are these related to each other, if not i will suggest to split this and keep 1 issue for single PR, it will be easy to review :) thanks for the work. |
5659791 to
99cfe5c
Compare
|
Thanks for the helpful suggestion @Aniketsy! That makes total sense and makes each feature much cleaner and easier to review independently. I have split them into three dedicated, standalone PRs:
Each PR now has its own isolated diff, targeted unit tests, benchmark validations, and AI disclosure checklist. |
|
Hi @Aniketsy, thank you for the feedback! You are completely right. I have already separated the other two features into independent, dedicated pull requests:
This pull request (#10248) is now strictly scoped to the Brant test for the proportional odds assumption in OrderedModel (closes #8442). I am also addressing the import cycle flagged by the static analysis check. Thanks again for your guidance! |
| exog_names = [f"x{i+1}" for i in range(K)] | ||
|
|
||
| # Fit J - 1 binary logit models | ||
| from statsmodels.discrete.discrete_model import Logit |
…loses statsmodels#8442) - Add brant_test() function and BrantResults class in statsmodels.discrete._diagnostics_ordered - Re-export brant_test and BrantResults in statsmodels.discrete.diagnostic - Add .brant_test() method to OrderedResults in statsmodels.miscmodels.ordinal_model - Supports logit and probit links, omnibus Wald test, and variable-by-variable tests - Validated against R's brant package on UCLA benchmark dataset - Unit tests added in statsmodels/miscmodels/tests/test_ordinal_model.py Signed-off-by: Shikhar Kesharwani <[email protected]>
Signed-off-by: Shikhar Kesharwani <[email protected]>
a07d2a9 to
ddb4fcf
Compare
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 the Brant test for evaluating the parallel regression / proportional odds assumption in ordinal response models (
OrderedModel), resolving issue #8442.Key features:
brant_test()instatsmodels.discrete._diagnostics_ordered(re-exported instatsmodels.discrete.diagnostic)..brant_test()post-estimation method directly onOrderedResultsinstatsmodels.miscmodels.ordinal_model.BrantResultscontainer with.wald_chi2,.df,.pvalues,.table, and formatted.summary().brantpackage on the UCLA ordinal logistic regression benchmark dataset (Omnibus:TestBrantTestwith 6 passing tests instatsmodels/miscmodels/tests/test_ordinal_model.py.