Add POOR - #940
Conversation
There was a problem hiding this comment.
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_iorname is incorrect for this function and makes the validation logic misleading. Rename it tovalid_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 returnsNaN, 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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…rmance into performance_poor
|
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? |
|
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) |
No description provided.