Skip to content

Smartphrase: estimands and intercurrent events as smartphrases #11

Description

@metadatadriven

Smartphrase: estimands and intercurrent events as smartphrases

Sub-issue of #9. The smartphrase layer demonstrated in #9 expresses an analysis; this extends it to express an estimand.

Purpose

Make ICH E9(R1) estimands a first-class thing the smartphrase layer can author and read back, so that an SAP passage carrying an estimand description and the model instance behind it remain two views of one thing — the same claim #9 makes for analyses.

The motivating observation is that four of the five E9(R1) attributes are already covered by the v0.7 phrase roles, without anyone having designed for it: treatment maps onto grouping, variable onto endpoint/parameter/timepoint, population onto population. The gaps are attribute 4 (intercurrent-event handling) and attribute 5 (the summary measure). That makes this a targeted extension rather than a new workstream.

Requirements

The extension succeeds if these are true. Solution choices are separate — see "Proposed approach", which is a design input, not a constraint.

  1. An estimand is expressible end-to-end. All five E9(R1) attributes can be authored as prose and read back as model metadata, bidirectionally, with no second copy — the one-state architecture of Smartphrase: demonstrate SAP <-> AC/DC model linkage (PoC for the working group) #9 is preserved.
  2. Intercurrent-event handling is explicit and typed. Each declared ICE carries exactly one ICH E9(R1) strategy per estimand, drawn from the typed enum rather than free text, and the prose states it in language a reviewer would accept.
  3. Strategy is connected to what actually implements it. A strategy is not merely asserted in prose; it resolves to the transformation(s) that operationalise it, so "hypothetical" in a sentence and an imputation step in the model cannot drift apart.
  4. The summary measure is verifiable, not decorative. The summary named in prose must be an output the bound method provably produces.
  5. Intercurrent events are traceable. An ICE phrase can be followed to how its per-subject occurrence is ascertained, and on to the data — a different trace axis from the analysis-value traces in Smartphrase: demonstrate SAP <-> AC/DC model linkage (PoC for the working group) #9.
  6. Per-estimand strategy overrides work. The same ICE handled one way for the primary estimand and another for a sensitivity estimand is expressible without duplicating the ICE.
  7. Standards alignment holds. Grounding in USDM/eSAP/ARS/ICH as Smartphrase: demonstrate SAP <-> AC/DC model linkage (PoC for the working group) #9 established; nothing invented where a term exists, and anything unregistered flagged illustrative.
  8. Zero-install still. Static files, file://, no build step, no server.

Proposed approach

Recorded in smartphrase/DESIGN.md under "Planned extension — estimands and intercurrent events", written during #9 and revisable. Summary:

  • The estimand is the instance level, not a phrase. The analysis instance grounds in a usdm:Estimand IRI as it grounds in an objective today. A correction falls out: the instance's free-string sentenceRole should bind to the typed Analysis.analysisRole (MainEstimator | SensitivityAnalysis | SupplementaryAnalysis).
  • Two new roles — a library minor-version event: ice_handling (repeating, like covariate) and summary_measure, the latter binding to a method output via the summarizedByOutputClass hook (e.g. M.ANCOVA's contrasts_t becomes "difference in least-squares means").
  • One smartphrase per strategy, strategy carried in anchors: SP_ICE_TREATMENT_POLICY ("regardless of {ice}"), SP_ICE_HYPOTHETICAL ("as if {ice} had not occurred"), SP_ICE_COMPOSITE ("with {ice} treated as {outcome}"), SP_ICE_WHILE_ON_TREATMENT ("using measurements taken prior to {ice}"), SP_ICE_PRINCIPAL_STRATUM ("in the stratum of participants in whom {ice} would not occur"). {ice} is a concept reference to a new registry kind IntercurrentEvent.
  • Strategy phrases change the shape of the instantiated model, not just slice values — the first phrases to do so, and the main thing to scrutinise. TreatmentPolicy modifies nothing; Hypothetical inserts an imputation transformation; Composite redefines the variable via a derivation producing a composite endpoint concept; WhileOnTreatment adds a timing-bounded slice constraint; PrincipalStratum changes the population definition.
  • Estimand-aware validation: one strategy phrase per declared ICE; exactly one MainEstimator per estimand; the summary phrase names a real method output; conditional template validity (e.g. SP_ICE_HYPOTHETICAL only where an imputation transformation exists to implement it).

Target prose:

Change from baseline in ADAS-Cog(11) at Week 24 in the efficacy population comparing treatment groups, as if discontinuation of study treatment had not occurred and regardless of use of concomitant AD medication, using ANCOVA … summarised as the difference in least-squares means, will be assessed as the primary estimand's main estimator.

The model side already exists

Verified on methods_02 (model/linkML/study_esap.schema.yaml, plus intercurrent-event-derivation.md for the ascertainment-versus-handling split):

Artefact What it gives this extension
Estimand USDM-referenced; carries variableOfInterest, analysisPopulation, interventions, intercurrentEvents
IntercurrentEvent The ICE itself, referenced by id and never modified
IceAscertainment eSAP-owned overlay: study-default strategy, event-driven ScheduleTimeline, and ascertainedBy — either OccurrenceCriterions naming a BC ▸ property ▸ code path, or a derivation. Strategy-independent, which is what makes the ICE trace a separate axis.
IceHandling Reified (Estimand, IntercurrentEvent, Strategy) triple with implementedBy — precisely the hook requirement 3 needs, and why requirement 6 works without duplicating the ICE
IchE9R1Strategy Typed enum: TreatmentPolicy, Hypothetical, Composite, WhileOnTreatment, PrincipalStratum
Analysis.analysisRole / AnalysisRole MainEstimator / SensitivityAnalysis / SupplementaryAnalysis
Analysis.summarizedByOutputClass The method-output hook for requirement 4

Notably IceHandling.implementedBy's own documentation already lists the per-strategy transformation patterns the proposed approach assumes (Composite → folding derivation, Hypothetical → imputation, TreatmentPolicy → omitted, WhileOnTreatment → censoring, PrincipalStratum → population subsetting). The model and phrase layers already agree on the semantics — this extension is a surface over them, not a redesign.

Suggested worked example — PrE0102

The breast-cancer SAP converted in #9 (smartphrase/SAP/) carries real intercurrent events rather than illustrative ones, in §4.4–4.5: everolimus discontinued for suspected toxicity while fulvestrant continues; treatment interruption capped at 3 weeks with permanent discontinuation beyond it; discontinuation at the subject's request; and disease progression itself. That supports a genuine Hypothetical-versus-TreatmentPolicy contrast on the same event, on a real document, in a therapeutic area where estimand framing is actively contested.

Known implementation consequences

  • This one does touch the language packs. Unlike the Kaplan-Meier work in Smartphrase: demonstrate SAP <-> AC/DC model linkage (PoC for the working group) #9, which needed no new role, adding ice_handling and summary_measure is a library minor-version event — and because each pack's sentence_template enumerates role tokens explicitly, a role absent from a template is dropped from the rendered sentence entirely. All three packs (EN/FR/DE) need their word order revised: ice_handling after grouping, summary_measure after the method qualifiers.
  • i18n stress test. The hypothetical strategy wants the German subjunctive — "als ob … nicht aufgetreten wäre" — inside the existing wird … untersucht verb bracket. Per-language phrase templates (decision D7) should accommodate this; it is a good test of whether they really do.
  • New registry kind. IntercurrentEvent concepts, as Event was added for time-to-event endpoints in Smartphrase: demonstrate SAP <-> AC/DC model linkage (PoC for the working group) #9.
  • Regression surface. Smartphrase: demonstrate SAP <-> AC/DC model linkage (PoC for the working group) #9 leaves three runnable gates (tools/verify.mjs with 69 pinned outputs across two studies, tools/build-library-subset.mjs --check, tools/verify-ui.mjs). All existing output must stay byte-identical except where a change is intended and justified.

Out of scope

Dependencies and branching

Inherited open questions from #9

These are working-group decisions that bear on this extension and are not resolved yet:

  1. Who accepts phrase and template contributions into the library, and what does that review look like? This extension proposes two new roles as well as phrases — a larger change than Smartphrase: demonstrate SAP <-> AC/DC model linkage (PoC for the working group) #9's single template.
  2. Registration of currently-illustrative identifiers, including a term for Kaplan-Meier estimation.
  3. Whether the identifier policy — resolve into USDM/ARS/STATO/NCIt wherever they cover the entity — becomes an AC/DC principle.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

T-shirt sizing

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions