Skip to content

binned_residuals() for checking linearity of the logit - #943

Merged
strengejacke merged 6 commits into
mainfrom
strengejacke/issue942
Aug 26, 2026
Merged

binned_residuals() for checking linearity of the logit#943
strengejacke merged 6 commits into
mainfrom
strengejacke/issue942

Conversation

@strengejacke

@strengejacke strengejacke commented Aug 26, 2026

Copy link
Copy Markdown
Member

Fixes #942

To do:

  • Update NEWS
  • version bump DESCRIPTION
  • update test-binned_residuals.R
  • add visual tests

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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() default residuals to "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.md and bump the development version in DESCRIPTION.

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 call glm(..., data = df) where df is undefined. This should be fixed (ideally by regenerating from roxygen after updating R/binned_residuals.R).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread R/binned_residuals.R
Comment thread NEWS.md Outdated
Comment thread R/binned_residuals.R
Comment thread tests/testthat/test-binned_residuals.R
Comment thread man/binned_residuals.Rd
@strengejacke
strengejacke merged commit 6cf1a87 into main Aug 26, 2026
14 of 22 checks passed
@strengejacke
strengejacke deleted the strengejacke/issue942 branch August 26, 2026 07:49
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.

binned_residuals() for checking linearity of the logit

2 participants