Repository navigation
ENH: Add standardized beta coefficients to RegressionResults (closes #3857) - #10250
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#3857) - Implements get_beta_coefficients() and beta_coefficients() on RegressionResults - Adds BetaCoefficientsResults class with params, bse, tvalues, pvalues, conf_int(), and summary() - Supports standardize_y options (both vs predictors only), ddof configuration, and handles constant intercepts correctly - Numerically validated against direct z-score standardized regression within machine precision (1e-16) Signed-off-by: Shikhar Kesharwani <[email protected]>
This was referenced Sep 13, 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
RegressionResults.get_beta_coefficients()(with aliasbeta_coefficients()) instatsmodels.regression.linear_model, addressing long-standing issue #3857.Key features:
BetaCoefficientsResultsclass providing.params,.bse,.tvalues,.pvalues,.conf_int(), and formatted.summary().standardize_y=False).lm.beta.TestBetaCoefficientswith 9 passing unit tests instatsmodels/regression/tests/test_regression.py.