Skip to content

Fix bootstrap CI scaling and selection.random standardization - #176

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

remlapmot merged 7 commits into
mainfrom
devel-2026-11-04

Conversation

@remlapmot

Copy link
Copy Markdown
Collaborator

The bootstrap sampling option has been niggling away at the back of my mind. I believe it needs this rescaling

  • Rescale bootstrap draws by sqrt(bootstrap.sample) so SEs and CIs refer to the full sample size; they were about 12% too wide at the default of 0.8. Ratios are rescaled on the log scale.

And this also

  • Weight trials kept by selection.random by 1 / selection.prob when standardizing risks and fitting the hazard-ratio Cox model, removing a bias in the risks.

Each bootstrap resample draws bootstrap.sample * n of the n subjects (an m-out-of-n bootstrap), so the spread of the bootstrap estimates reflects a sample of size m and the standard errors and confidence intervals were about 1 / sqrt(bootstrap.sample) times too wide - about 12% at the default of 0.8. The draws are now shrunk towards the full-data estimate by sqrt(bootstrap.sample) before the SE or percentile interval is taken, for the risks and their differences and ratios, hazard ratios, and end-of-follow-up estimates. Results with bootstrap.sample = 1 are unchanged.
selection.random keeps a proportion selection.prob of the trials starting on the first level of treat.level, but the risk curves and the hazard-ratio simulation standardized over the kept trials unweighted, under-representing that arm's covariate distribution: in SEQdata with selection.prob = 0.3 both ITT risks at follow-up 60 averaged about 0.011 too high over 20 seeds. Kept first-level trials now carry weight 1 / selection.prob in the standardization and in the hazard-ratio Cox fit, which removes the bias. The outcome and weight models are unchanged, as selection depends only on baseline treatment. Bootstrap CIs already include the selection variability (resampling subjects from the kept trials is equivalent to resampling then selecting; checked by simulation), so the documentation now says so instead of changing them.
@remlapmot
remlapmot requested a review from ryan-odea November 4, 2026 12:59

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

Sorry for the delay - took me a bit to wrap my head around the issue.
Looks good!

@remlapmot
remlapmot merged commit c98a8ec into main Nov 10, 2026
7 checks passed
@ryan-odea
ryan-odea deleted the devel-2026-11-04 branch November 10, 2026 16:39
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