Fix 17 test failures: probability vectors, object init, vestigial dataset, boundary SE detection#1
Closed
Fix 17 test failures: probability vectors, object init, vestigial dataset, boundary SE detection#1
Conversation
…, remove birthweight test, enhance SE detection Co-authored-by: jackmurphy2351 <120122776+jackmurphy2351@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix test failures in riskdiff test suite
Fix 17 test failures: probability vectors, object init, vestigial dataset, boundary SE detection
Feb 25, 2026
jackmurphy2351
approved these changes
Feb 25, 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.
17 test failures caused by mismatched probability vector lengths, a forward-reference in
data.frame(), a test referencing a removed dataset, and incomplete large-SE boundary detection logic.Changes
tests/testthat/test-calc-risk-diff.RAge probability vector (
create_cachar_inspired_data):18:70is 53 values; originalprobargument supplied 73 weights. Replaced with explicit length-matched array normalized to sum to 1:Object initialization (
create_convergence_challenge_data):exposurewas referenced insidedata.frame()before it existed. Refactored to build the frame first, then assignoutcome_probandoutcomeas follow-on steps.Removed birthweight test:
birthweightdataset was replaced bycachar_samplein a prior iteration; test referencing it was dead code causing a load failure.R/boundary_detection.RSE / |coef| > 2), which misses cases where the coefficient itself is near zero. Detection now triggers on either absolute SE > 2.0 or relative ratio > 2.0 (guarded against all-small-coefficient false positives).Original prompt
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.