Skip to content

Add risk_times option, ensure stable factor encoding, and a css tweak#49

Merged
remlapmot merged 7 commits into
mainfrom
devel-2026-05-19
May 27, 2026
Merged

Add risk_times option, ensure stable factor encoding, and a css tweak#49
remlapmot merged 7 commits into
mainfrom
devel-2026-05-19

Conversation

@remlapmot
Copy link
Copy Markdown
Contributor

@remlapmot remlapmot commented May 22, 2026

This adds the two most recent additions to the R package:

  • Add risk_times option

  • Ensure stable factor encoding for categorical time-varying covariates in the outcome model

Also I find the top nav bar on the readthedocs a bit too tall (it even obscures some of the side menus sometimes), e.g., screenshot of https://pyseqtarget.readthedocs.io/en/latest/ in Chrome

CleanShot 2026-05-22 at 13 01 19@2x

So I've tweaked with the css for that,

  • Reduce the height and padding of the piccolo_theme top navigation bar

remlapmot added 7 commits May 19, 2026 11:33
_calculate_risk predicted the discrete hazard on followup = 1..followup_max, which silently dropped the first interval's hazard (followup = 0, where an event can already occur in the expanded data) and ended the curve one step short. The first survival step used h(1) instead of h(0), shifting every point and biasing risks downward.

Predict on the full grid (0..followup_max) and shift the curve labels +1 after the cumulative product so followup = k means "survival/risk after k elapsed intervals", giving rows 0..followup_max+1. The shift is applied before _store_boot_risks and the bootstrap CI join, so _boot_risks, _resolve_risk_times, and the paired RD/RR computation stay aligned. This matches the SEQTaRget (R) survival output.
@remlapmot remlapmot requested a review from ryan-odea May 22, 2026 06:12
@remlapmot remlapmot merged commit b40948a into main May 27, 2026
6 checks passed
@remlapmot remlapmot deleted the devel-2026-05-19 branch May 27, 2026 08:50
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