Skip to content

Fix bootstrap scaling and selection_random standardization - #64

Merged
remlapmot merged 8 commits into
mainfrom
devel-2026-11-10
Nov 11, 2026
Merged

remlapmot merged 8 commits into
mainfrom
devel-2026-11-10

Conversation

@remlapmot

Copy link
Copy Markdown
Contributor

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).

@remlapmot
remlapmot requested a review from ryan-odea November 10, 2026 15:49

@ryan-odea ryan-odea left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Everything looks good! I've just added a small bugfix to spline singular matrices

Comment thread pySEQTarget/analysis/_outcome_fit.py Resolved
@remlapmot
remlapmot merged commit 6a9928e into main Nov 11, 2026
7 checks passed
@remlapmot
remlapmot deleted the devel-2026-11-10 branch November 11, 2026 10:25
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.

2 participants