# Deviation log — tte-benzo-cirrhosis-he

SAP frozen: 2026-10-18 (v1.0). Any primary-analysis change after freezing must be registered here.
**A primary-analysis change made after seeing outcomes = post-hoc selection and is not publishable as pre-specified.**

| ID | Date | Event | As planned | As done | Rationale | Outcomes seen? |
|---|---|---|---|---|---|---|
| D-01 | 2026-10-18 (pre-freeze) | Exposure channel | inputevents (IV) only | Any route (IV + pharmacy/eMAR) | Oral benzodiazepines remaining in the control arm would misclassify exposure; probe found 417 stays with oral-only records | **Yes** (crude IV-only rates 41.0% vs 26.0% already seen) — user decision, direction widened the exposed arm; disclosed in SAP honesty statement |
| D-02 | 2026-10-18 (pre-freeze) | New-user exclusion | inputevents pre-ICU records only | Added pharmacy/eMAR pre-ICU records (746 stays) | Ward-exposed patients would enter both arms (64 exposed, 185 control), violating new-user design | **Yes** (same); exclusion tightened; crude rates 36.2/24.4 → frozen values; disclosed |
| D-03 | 2026-10-18 (pre-freeze) | Code corrections | albumin 50943 / ammonia 50983 / sodium 50824 (from memory) | 50862 / 50866 / 50983 (verified in d_labitems) | Memory-based itemids caught by verification self-check | No (coverage check only) |
| D-04 | 2026-10-18 (pre-freeze) | Funnel first-pass assertion FAIL ×2 | — | Re-run after fixing assertion wording, 8/8 pass | The assertions themselves were wrong (not intersected with the final set), not the data | No |
| D-05 | 2026-10-18 (post-freeze, P1 code audit) | Sensitivity registry expanded | Withdrawal-benzodiazepine sensitivity excluding only chlordiazepoxide-class (43 stays) | Added: also exclude **CIWA-protocol administrations** (pharmacy 3,721 rows; 33 stays in final exposed arm) | P1 code audit found CIWA-protocol drug names falling into the exposed arm under the any-route definition; **primary unchanged**, only an expanded sensitivity exclusion | No |
| D-06 | 2026-10-18 (post-freeze, P5 numeric incident) | Censoring-model estimator | Unpenalised GLM | GLM + L2 (alpha=0.01) + probability clipping [1e-4, 1-1e-4]; marginal OR derived from weighted risks | Unpenalised GLM **completely separated** in both arms → prediction overflow, NaN weights, RD=NaN (only 105/500 bootstrap replicates survived); regularisation is the standard remedy for separation. Covariates, weight structure and truncation unchanged — estimator fix only | Yes (after the first estimate failed) — numeric repair, not a definition change; separation documented in G2 diagnostics |
| D-07 | 2026-10-18 (post-freeze, user-requested) | Exploratory subgroups added | SAP §10 did not list subgroups | Added 5 stratifications (mechanical ventilation / RASS / alcohol-related / age / INR, all pre-exposure variables), Woolf CIs, labelled exploratory throughout | Following the template paper's (Qin & Zou 2026) subgroup-forest convention; **added after seeing the primary result**; labelled hypothesis-generating + multiple-comparisons caveat | **Yes** — post-hoc, labelled as such |
| D-08 | 2026-10-18 (post-freeze) | SAP-promised items completed | — | Added §8 post-weighting SMD and §5 ICU LOS | Completing pre-registered content; post-weighting SMD revealed **worsened balance in age/lactate/RASS/vasopressors** (new finding → Results + Limitations); LOS reported as median + 28/7-day-truncated means (untruncated weighted means dominated by extreme outliers; first version had an hours→days unit error, caught by self-check) | Yes — diagnostic disclosure, reinforcing the non-causal framing |
| D-09 | 2026-10-18 (**major numeric incident**, traced from D-08's post-weighting SMD) | **IPCW weight formula inverted** | Uncensored-clone weight = p0/p1 (p1 = P(censored\|X)) | **Corrected to p0/(1−p1)** (divide by P(uncensored\|X)); the entire chain re-estimated in p85_corrected_all.py; previous weighted results (RD +22.9pp, "positive" negative controls, unbalanced SMD, old survival/subgroup/LOS) **all voided** | Investigation of worsening post-weighting SMD: first ruled out truncation (no change without), positivity was normal, finally located the inverted formula (weights amplified "typical exposers" instead of "atypical"). After correction: SMD balanced (max 0.105), RD converged to +6.3pp, **both negative-control CIs include 0 (G5 passed)** | Yes — numeric defect repair (estimator written backwards), not a definition change; full timeline and voiding statement archived |
| D-10 | 2026-10-18 (audit round) | ① Cluster-bootstrap mapping ② E-value not actually computed | dict(subject→stay) collapsed multi-stay patients (~300 stays silently dropped per replicate); E-value stated in text as "about 1.3" without computation | defaultdict(subject→[all stays]) full-stay cluster resampling (p86); E-value computed: RR=1.22, E=1.74 | ① Primary CI updated to 0.4–13.3 (p=0.046, more borderline); later superseded by the 1000-replicate run (p26: 0.7–13.2, p=0.030); ② manuscript corrected | Yes — audit-driven numeric repair |
| D-11 | 2026-10-24 (sensitivity-expansion round) | p82 "confirmatory" rerun reintroduced the D-09 inverted formula and overwrote p80_negative_control_confirmatory.json | p80 should hold the correct-formula 1000-replicate negative-control bootstrap | p26_sens_bootstrap.py re-estimates uniformly with the corrected formula + D-10 cluster mapping (10 variants × 1000 reps, including negative controls); p82's formula fixed in place with a warning comment | The manuscript's NC CIs (−4.7 to 9.8 etc.) came from the overwritten early correct run; the on-disk p80 held void numbers (primary RD 0.2286/p=0.0); the manuscript now uses p26's authoritative values | Yes — caught by a reconciliation assertion during sensitivity expansion |
| D-12 | 2026-10-24 (curve-figure round) | p50_survival's Aalen-Johansen used D-09 inverted weights (p51's AJ 67.1%/42.9% void); p32 had overwritten the real curves with bar charts | AJ must use the corrected primary CCW weights; Figure 5 must be real curves | p34_fig5_curves.py: re-estimated AJ with corrected weights (55.3%/51.2%), reconciled wKM/RMST against p85's survival block item-by-item before plotting (AJ + wKM 7 d/28 d panels + number-at-risk tables) | Manuscript AJ numbers and Figure 5 caption updated; new values archived in p34_curves.json | Yes — surfaced when the user noted the missing curve figure |
| D-13 | 2026-10-24 (figure-merge round) | Truncation-sensitivity figure sourced from p70_identifiability.json (pre-D-09 values, y-axis 22.6–23.0pp), contradicting the text's +3.9 to +8.2; its ±1pp band was decorative | Truncation figure must use p85 corrected values; no uncertainty band without a source | p37_fig4_combined.py uses p85 truncation_curve (y-axis 4–10pp), decorative band removed; former Figures 4 and 6 merged into new Figure 4(a)(b), figure numbering reduced to 1–5 | Old fig4_truncation/fig6_subgroups deleted | Yes — exposed when OCR read the y-axis as 22.95 during a merge-review vision pass |
