Repository navigation
Fix bootstrap scaling and selection_random standardization - #64
Merged
Merged
Conversation
ryan-odea
approved these changes
Nov 10, 2026
ryan-odea
left a comment
Collaborator
There was a problem hiding this comment.
Everything looks good! I've just added a small bugfix to spline singular matrices
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.
This is the equivalent of the latest PR to SEQTaRget CausalInference/SEQTaRget#176
Each bootstrap resample draws bootstrap_sample * n of the n subjects (an m-out-of-n bootstrap), so standard errors and confidence intervals were about 1 / sqrt(bootstrap_sample) times too wide - about 12% at the default of 0.8. The bootstrap draws are now rescaled by sqrt(bootstrap_sample) around the full-data estimate before the SE or percentile interval is taken, for the risk curves, risk differences and ratios, hazard ratios, and end-of-follow-up estimates; ratios are rescaled on the log scale. Results with bootstrap_sample = 1 are unchanged.
selection_random keeps a proportion selection_sample of the ID-trials starting on the first level of treatment_level, but the risks and the hazard-ratio simulation standardized over the kept ID-trials unweighted, so both ITT risks in SEQdata with selection_sample = 0.3 averaged about 0.009 too high over 5 seeds. The kept ID-trials of that arm now carry weight 1 / selection_sample in the standardization and in the hazard-ratio Cox fit (always via lifelines, as scikit-survival's Cox model takes no weights).