Update repo

This commit is contained in:
2026-06-08 10:15:36 -07:00
parent 73e5d46c30
commit 867c37696f
15 changed files with 1899 additions and 5 deletions
+15 -5
View File
@@ -75,11 +75,11 @@ The main teaching example is an ICU septic shock study:
- [x] Simulate a simple ICU observational cohort.
- [x] Define the target trial protocol explicitly.
- [x] Estimate a naive observational association.
- [ ] Show why naive comparison can be biased.
- [ ] Align time zero and eligibility criteria.
- [ ] Introduce treatment assignment windows.
- [ ] Add censoring logic.
- [ ] Add inverse probability weighting from first principles.
- [x] Show why naive comparison can be biased.
- [x] Align time zero and eligibility criteria.
- [x] Introduce treatment assignment windows.
- [x] Add censoring logic.
- [x] Add inverse probability weighting from first principles.
- [x] Refactor repeated logic into reusable project functions.
- [ ] Re-implement selected steps with external dependencies.
- [ ] Build wrapper functions around external dependency workflows.
@@ -131,5 +131,15 @@ Initial estimand:
- `scripts/01_simulate_icu_data.R`: simulate an ICU cohort in memory and print a quick `skimr` summary.
- `R/simulate_icu_cohort.R`: first reusable simulation primitive.
- `R/estimate_naive_vasopressor_mortality_effect.R`: shared naive mortality-effect primitive used by notebook workflows.
- `R/estimate_standardized_vasopressor_mortality_effect.R`: shared outcome-regression standardization primitive.
- `R/estimate_iptw_vasopressor_mortality_effect.R`: shared inverse-probability-of-treatment weighting primitive with unstabilized weights, propensity model diagnostics, weighted baseline balance, and weighted effect estimates.
- `notebooks/01_target_trial_basics.qmd`: report-style walkthrough of the target trial protocol and initial results.
- `notebooks/02_explore_simulated_data.qmd`: exploratory visual diagnostics for the simulated cohort.
- `notebooks/03_why_naive_analysis_is_biased.qmd`: explanation of confounding by indication and first standardized mortality-effect estimate.
- `notebooks/04_inverse_probability_weighting.qmd`: IPTW from first principles, weight diagnostics, baseline balance table, weighted effect estimates, and a three-way comparison of naive, standardized, and IPTW results.
- `R/simulate_icu_cohort_longitudinal.R`: longitudinal simulation primitive with time-varying covariates, treatment timing, and censoring events at sparse time points.
- `R/clone_trial_arms.R`: cloning function that duplicates each eligible patient into two trial arms at time zero and applies censoring rules at the 2-hour mark.
- `R/estimate_iptw_and_ipcw_effect.R`: combined IPTW + IPCW weighting primitive for per-protocol effect estimation in the cloned dataset.
- `notebooks/05_treatment_assignment_windows.qmd`: treatment assignment windows, grace periods, cloning mechanics, and censoring rules.
- `notebooks/06_censoring_and_ipcw.qmd`: inverse probability of censoring weighting, combined weight diagnostics, and comparison with cross-sectional IPTW.
- `notebooks/07_full_emulation_pipeline.qmd`: end-to-end target trial emulation pipeline with four-way comparison of naive, standardized, cross-sectional IPTW, and longitudinal IPTW + IPCW methods.