D53: landmark on baseline covariates (month-5 version as landmark_m5), NCO-1 depends on PVI-free severity, physician-cluster bootstrap script

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-28 07:20:32 -04:00
co-authored by Claude Opus 5.5
parent fbc417662c
commit 5304c89316
10 changed files with 86 additions and 18 deletions
+3 -2
View File
@@ -17,13 +17,14 @@ oracle_records <- function(rec) {
o
}
#' Oracle versions of the landmark and naive designs (V1, patient-level SE).
#' Oracle versions of the landmark (both versions) and naive designs (V1, patient-level SE).
run_oracle <- function(rec, outcomes = c(male = "t_male", disease = "t_disease", nco1 = "t_nco1", nco2 = "t_nco2")) {
o <- oracle_records(rec)
rbindlist(lapply(names(outcomes), function(nm) {
lm <- est_landmark(o, outcomes[[nm]], "V1_ignore", extra_covs = o$extra_covs)
l5 <- est_landmark(o, outcomes[[nm]], "V1_ignore", extra_covs = o$extra_covs, at_landmark = TRUE)
nv <- est_naive(o, outcomes[[nm]], "V1_ignore", extra_covs = o$extra_covs)
rbind(cbind(design = "landmark", lm), cbind(design = "naive", nv))[
rbind(cbind(design = "landmark", lm), cbind(design = "landmark_m5", l5), cbind(design = "naive", nv))[
, `:=`(outcome = nm, contrast = "early_none", variant = "oracle", se = se_patient)]
}))
}