binned_residuals() for checking linearity of the logit - #943
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts binned_residuals() to better support checking linearity of the logit for logistic regression by changing the default residual type from deviance to response residuals (per Gelman & Hill), and updates package metadata and tests accordingly.
Changes:
- Change
binned_residuals()defaultresidualsto"response"and update parameter documentation to justify the default. - Update test expectations and add a new simulation-based test around the “linearity of the logit” use case.
- Record the breaking change in
NEWS.mdand bump the development version inDESCRIPTION.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| R/binned_residuals.R | Changes default residual type and updates roxygen docs/examples. |
| tests/testthat/test-binned_residuals.R | Updates expectations for new default and adds simulation validation test. |
| NEWS.md | Notes the breaking change in default residual type. |
| man/binned_residuals.Rd | Updates generated documentation to reflect new defaults/docs. |
| DESCRIPTION | Bumps the package development version. |
Files not reviewed (1)
- man/binned_residuals.Rd: Generated file
Suppressed comments (1)
man/binned_residuals.Rd:110
- The Rd examples currently error: they create
d <- ...but then callglm(..., data = df)wheredfis undefined. This should be fixed (ideally by regenerating from roxygen after updatingR/binned_residuals.R).
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Fixes #942
To do: