Skip to content

[v0.5] Generate survival variable pairs inside create_mock_data() #40

Description

@DougManuel

Part of the post-v0.4.0 development plan (development/post-v040-development-plan.md, Phase 2, Task 7).

Context

Longest-standing known issue (NEWS, since v0.2.0): survival data must be generated manually with create_wide_survival_data() because it produces paired entry/event columns, while create_mock_data() assembles one column per variable.

Metadata is already plumbed: followup_min, followup_max, event_prop flow through the recodeflow adapter onto spec variables (R/mock_spec_recodeflow.R:367-369); rate/shape likewise (:365-366). The blocker is architectural, not statistical.

Design decisions (small design note, then implement)

  1. Pairing convention in metadata — how an event variable names its entry/anchor variable. Plan recommendation: an explicit anchor extension column on the event variable's row.
  2. Multi-column generator contract — a spec variable of type survival whose generator returns a 2-column data frame; assembly loop accepts multi-column returns; validate_mock_spec() checks pairing integrity (anchor exists, is a date variable, ordering constraints).
  3. Diagnostics attribution — both columns attributed to the one spec entry in mockdata_diagnostics.

Acceptance

  • create_mock_data() generates entry/event pairs from metadata alone (no manual create_wide_survival_data() call).
  • Event/censoring proportions tested with two-sided bounds (fulfils Add survival censoring and LTFU regression tests #23's direction).
  • Known-issue entry removed from NEWS with a migration note.

Relates to #17, #23.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Important, should be done soon

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions