You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A critical review of the ITT statistical-model implementation found that the core single-outcome model is statistically defensible and internally consistent, but the code is not ready for unconditional publication sign-off. Two publication-facing release-gate problems can expose findings before required robustness evidence is validated, and two edge cases can produce inconsistent or pseudo-replicated estimates.
The ordinary single-outcome model correctly treats randomised assignment as identifying the treatment effect, uses own baseline and linear age as precision terms, validates bounded counts, fits a Beta-Binomial working likelihood, reports counterfactual average marginal effects on probability and item scales, and applies comprehensive convergence diagnostics. The remaining work is principally about making the reporting guarantees match the methodological contract and hardening supported data paths.
Findings
P1: the P/N floor-sensitivity gate does not gate the findings-first summary
_kf_build_itt() handles the post-hoc P/N floor-rule models as ordinary ITTs. It emits a headline and an unqualified cause-and-effect sentence before the floor-sensitivity release gate in _results_floored.qmd is reached.
The locally stored P and N reporting artefacts have key_findings.json status ok even though tau has a potential prior-data-conflict diagnosis and the required floor_tau_prior_sensitivity.csv is absent. The later report section can say that the release gate failed, but readers have already seen an apparently released findings box.
Recommendation: make key-findings generation floor-aware. Validate the trace-backed 3 × 2 sensitivity grid before emitting scientific findings; otherwise return a dedicated robustness_unresolved or withheld status. The causal sentence must identify this as a post-hoc, baseline-floor, available-case subgroup contrast subject to eligibility and outcome-missingness assumptions.
P1: ordinary ITT key findings ignore diagnosed prior sensitivity
_emit_itt_extras() computes psense, but generate_key_findings() checks only the sampling-quality gate. A potential tau prior-data conflict therefore does not change report or key-findings status.
The stored reporting artefacts, generated from commit 898ea03691b06403aee1d45bef306336dd18a22a, flag potential tau prior-data conflict in ten non-floor ITT or robustness fits while still producing status-ok findings. This is methodologically material because the distal treatment-prior tier was selected after the original ITT posterior table existed. The trace-validated 44-cell standard sensitivity sweep is strong, but it is separate from individual report release, is not locally present in the default output root, and does not cover every affected model or robustness variant.
Recommendation: classify tau sensitivity before key-findings generation. When a conflict is present, bind the report to appropriate provenance-validated sensitivity evidence or explicitly withhold/qualify the findings. Define the policy for base models, adjusted robustness models, and outcomes outside the current standard grid rather than treating all conflicts as informational.
tau_summary_joint() correctly uses the flattened cell maps to average each outcome over rows where it is observed. joint_treatment_marginals() independently averages over every fitted row.
A synthetic posterior with outcome-specific missingness reproduced materially different item-scale estimates from the two summaries. The current registered joint datasets are complete on their selected outcome sets, so current estimates are unaffected, but the joint factory explicitly supports outcome-specific missing post-scores.
Recommendation: make every joint summary call _joint_ame_draws() or a single successor. Define whether cross-outcome contrasts target each outcome's observed population or a common complete-case population, record that population in the artefacts, and test all summary/key-finding paths under asymmetric missingness.
P2: the primary longitudinal loader does not enforce key integrity
load_and_prepare() does not reject duplicate (subject_id, time) rows or treatment-group changes within a subject before the pre/post merge. A duplicated t1 row was reproduced as two fitted observations for one child, silently giving that child additional likelihood weight.
The current source CSV is clean: 216 rows, 54 subjects, no duplicate subject-time keys, and stable assignment. This is nevertheless a latent correctness defect for future data. The floor and historical loaders already contain suitable fail-loud validation patterns.
Recommendation: validate subject-time uniqueness, allowed waves, and time-invariant randomised group immediately after reading the source data and before any transition or baseline merge.
Methodological qualifications to preserve
Describe the single-outcome estimand as an available-case modified ITT effect, not an unqualified full-population ITT effect.
Treat the Beta-Binomial as a working model for bounded total scores, not as evidence of literal item exchangeability.
Keep P/N explicitly post-hoc and exploratory.
Treat factorised joint-model per-outcome effects as usable marginal estimates, but do not present cross-outcome effect differences as definitive paired contrasts without a dependence-aware or randomisation-based sensitivity analysis.
Keep the large outcome family and post-hoc practical thresholds visible when interpreting posterior direction probabilities.
Refactoring recommendations
Move fit_itt, the floor branch, and fit_joint from the 9,000-line pipeline.py into family-owned pipeline modules or classes while retaining the shared stage runner.
Introduce typed JointIttSettings and JointIttRunPlan contracts; joint models still consume loosely typed spec.extra values.
Replace the two drifting prepared-data subset helpers with PreparedData.subset(mask, reason=...), recording missingness exclusions, eligibility restrictions, and factory drops separately.
Centralise ITT/joint counterfactual summaries and define an explicit averaging-population type.
Centralise release policy so convergence, prior sensitivity, floor grids, and other required robustness evidence are evaluated before key findings are generated.
Separate validated model/run contracts from report-prose rendering to make the statistical specification easier for unfamiliar readers to inspect.
Acceptance criteria
P/N key findings are withheld when the required floor sensitivity is missing, invalid, or not provenance-aligned.
P/N key findings explicitly identify the post-hoc baseline-floor subgroup and missingness assumptions when released.
A standard tau prior-data conflict changes report/key-findings status unless appropriate validated sensitivity evidence is attached.
Joint probability- and item-scale summaries use the same declared observation mask and averaging population.
Cross-outcome contrasts either use a common population or explicitly identify differing populations.
Duplicate subject-time rows and within-subject group inconsistencies fail before pre/post merging.
Regression tests cover each failure mode.
The family refactor preserves the resolved run plan, model recipe, output schema, and all-free-variable convergence gate.
A fresh reporting-scale refit or provenance-validated trace reuse confirms the corrected end-to-end reporting path.
Review evidence
336 focused ITT, preprocessing, factory, reporting, diagnostics, key-findings, and sensitivity-contract tests passed.
Relevant source files passed Ruff.
The 31 locally stored ITT/joint reporting fits all passed their sampling-quality gates: zero divergences, maximum R-hat 1.000821, minimum ESS 6,525, and minimum BFMI 0.945.
Those posterior artefacts predate current HEAD and subsequent pipeline/reporting changes, so they support the unchanged model construction but are not an end-to-end verification of the current reporting path.
Note
Drafted by a LLM-based AI tool (Codex/GPT-5).
Summary
A critical review of the ITT statistical-model implementation found that the core single-outcome model is statistically defensible and internally consistent, but the code is not ready for unconditional publication sign-off. Two publication-facing release-gate problems can expose findings before required robustness evidence is validated, and two edge cases can produce inconsistent or pseudo-replicated estimates.
The ordinary single-outcome model correctly treats randomised assignment as identifying the treatment effect, uses own baseline and linear age as precision terms, validates bounded counts, fits a Beta-Binomial working likelihood, reports counterfactual average marginal effects on probability and item scales, and applies comprehensive convergence diagnostics. The remaining work is principally about making the reporting guarantees match the methodological contract and hardening supported data paths.
Findings
P1: the P/N floor-sensitivity gate does not gate the findings-first summary
_kf_build_itt()handles the post-hoc P/N floor-rule models as ordinary ITTs. It emits a headline and an unqualified cause-and-effect sentence before the floor-sensitivity release gate in_results_floored.qmdis reached.The locally stored P and N reporting artefacts have
key_findings.jsonstatusokeven thoughtauhas a potential prior-data-conflict diagnosis and the requiredfloor_tau_prior_sensitivity.csvis absent. The later report section can say that the release gate failed, but readers have already seen an apparently released findings box.Recommendation: make key-findings generation floor-aware. Validate the trace-backed 3 × 2 sensitivity grid before emitting scientific findings; otherwise return a dedicated
robustness_unresolvedor withheld status. The causal sentence must identify this as a post-hoc, baseline-floor, available-case subgroup contrast subject to eligibility and outcome-missingness assumptions.P1: ordinary ITT key findings ignore diagnosed prior sensitivity
_emit_itt_extras()computespsense, butgenerate_key_findings()checks only the sampling-quality gate. A potentialtauprior-data conflict therefore does not change report or key-findings status.The stored reporting artefacts, generated from commit
898ea03691b06403aee1d45bef306336dd18a22a, flag potentialtauprior-data conflict in ten non-floor ITT or robustness fits while still producing status-okfindings. This is methodologically material because the distal treatment-prior tier was selected after the original ITT posterior table existed. The trace-validated 44-cell standard sensitivity sweep is strong, but it is separate from individual report release, is not locally present in the default output root, and does not cover every affected model or robustness variant.Recommendation: classify
tausensitivity before key-findings generation. When a conflict is present, bind the report to appropriate provenance-validated sensitivity evidence or explicitly withhold/qualify the findings. Define the policy for base models, adjusted robustness models, and outcomes outside the current standard grid rather than treating all conflicts as informational.P2: joint item-scale marginals ignore outcome-specific observation masks
tau_summary_joint()correctly uses the flattened cell maps to average each outcome over rows where it is observed.joint_treatment_marginals()independently averages over every fitted row.A synthetic posterior with outcome-specific missingness reproduced materially different item-scale estimates from the two summaries. The current registered joint datasets are complete on their selected outcome sets, so current estimates are unaffected, but the joint factory explicitly supports outcome-specific missing post-scores.
Recommendation: make every joint summary call
_joint_ame_draws()or a single successor. Define whether cross-outcome contrasts target each outcome's observed population or a common complete-case population, record that population in the artefacts, and test all summary/key-finding paths under asymmetric missingness.P2: the primary longitudinal loader does not enforce key integrity
load_and_prepare()does not reject duplicate(subject_id, time)rows or treatment-group changes within a subject before the pre/post merge. A duplicated t1 row was reproduced as two fitted observations for one child, silently giving that child additional likelihood weight.The current source CSV is clean: 216 rows, 54 subjects, no duplicate subject-time keys, and stable assignment. This is nevertheless a latent correctness defect for future data. The floor and historical loaders already contain suitable fail-loud validation patterns.
Recommendation: validate subject-time uniqueness, allowed waves, and time-invariant randomised group immediately after reading the source data and before any transition or baseline merge.
Methodological qualifications to preserve
Refactoring recommendations
fit_itt, the floor branch, andfit_jointfrom the 9,000-linepipeline.pyinto family-owned pipeline modules or classes while retaining the shared stage runner.JointIttSettingsandJointIttRunPlancontracts; joint models still consume loosely typedspec.extravalues.PreparedData.subset(mask, reason=...), recording missingness exclusions, eligibility restrictions, and factory drops separately.Acceptance criteria
tauprior-data conflict changes report/key-findings status unless appropriate validated sensitivity evidence is attached.Review evidence