Skip to content

Add POOR - #940

Merged
strengejacke merged 4 commits into
mainfrom
performance_poor
Aug 24, 2026
Merged

Add POOR#940
strengejacke merged 4 commits into
mainfrom
performance_poor

Conversation

@strengejacke

Copy link
Copy Markdown
Member

No description provided.

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

Adds and exports performance_poor() for logistic multilevel models, with tests, documentation, examples, and version updates.

Changes:

  • Implements POOR calculations and print support.
  • Adds tests and generated documentation.
  • Updates MOR/IOR examples, NEWS, namespace, and package version.

Reviewed changes

Copilot reviewed 8 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Review summary
tests/testthat/test-performance_poor.R Reviewed; no final comments.
tests/testthat/test-performance_mor.R Reviewed; no final comments.
R/performance_poor.R Critical: restrict calculations to logit models and handle random-slope or no-intercept models correctly. Nit: clarify the returned fraction versus percentage scale.
R/performance_mor.R Reviewed; no final comments.
R/performance_ior.R Reviewed; no final comments.
NEWS.md Nit: correct rations to ratios.
NAMESPACE Reviewed; no final comments.
man/performance_poor.Rd Reviewed; no final comments.
man/performance_mor.Rd Reviewed; no final comments.
man/performance_ior.Rd Reviewed; no final comments.
DESCRIPTION Reviewed; no final comments.
Files not reviewed (3)
  • man/performance_ior.Rd: Generated file
  • man/performance_mor.Rd: Generated file
  • man/performance_poor.Rd: Generated file
Suppressed comments (2)

R/performance_poor.R:52

  • The copied valid_ior name is incorrect for this function and makes the validation logic misleading. Rename it to valid_poor, including the conditional below.
  valid_ior <- .valid_roc_models(x) &&

R/performance_poor.R:72

  • When both a fixed-effect estimate and a random-intercept variance are exactly zero, this computes 0 / sqrt(0) and returns NaN, contradicting the documented bounded POOR value. Zero random-effect variances are already possible in the singular fit used by this PR; define the zero/zero case explicitly and add a regression test.
        POOR = stats::pnorm(-abs(params$Estimate) / sqrt(2 * v_a[tau])),

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

Comment thread NEWS.md Outdated
Comment thread R/performance_poor.R
Comment thread R/performance_poor.R
Comment thread R/performance_poor.R Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@strengejacke
strengejacke merged commit 31994d1 into main Aug 24, 2026
13 of 22 checks passed
@strengejacke
strengejacke deleted the performance_poor branch August 24, 2026 14:53
@DominiqueMakowski

Copy link
Copy Markdown
Member

that's interesting, i was recently thinking of something similar, is there a reference to that? Can't this be generalized to any type of coefs not just odds ratios?

@strengejacke

Copy link
Copy Markdown
Member Author

Look for merlo and logistic multilevel. One reference is https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0153778 (should add that to the function, too)

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.

3 participants