Merck / simtrial

Clinical trial simulation for time-to-event endpoints
https://merck.github.io/simtrial/
GNU General Public License v3.0
16 stars 8 forks source link

Get `ratio` as an attributes of `sim_pw_surv` and pass it to `wlr` #281

Closed LittleBeannie closed 18 hours ago

LittleBeannie commented 1 week ago

image

nanxstats commented 1 week ago

It may be useful to have a vignette to document the randomization ratio workflow in simtrial. I'm happy to send a PR to create a vignette with the following Mermaid JS diagram digitalized from notes above but you'll need to fill out the text.

Untitled diagram-2024-09-11-015305

---
config:
  theme: mc
---
flowchart TB
    A["Data input"] --> B("Simulated via <code>sim_pw_surv()</code>") & C["Custom input"]
    B -- "attr <code>ratio</code>" --> D["<code>wlr.tte_data()</code>"] & E["<code>counting_process()</code>"]
    E -- "attr <code>ratio</code>" --> F["<code>wlr.counting_process()</code>"]
    C -- "① User-defined<br>② Empirical" --> G["<code>wlr.tte_data()</code>"]
    C --> H["<code>counting_process()</code>"]
    H --> I["<code>wlr.counting_process()</code>"]
    H -.-> J["Empirical ratio calculation"]
    J --> K["User-provided ratio"] & L["No user-provided ratio"]
    K --> M["Use user's ratio"]
    L --> N["Use empirical ratio"]
    style A stroke-width:1px,stroke-dasharray: 0
    style H stroke-width:1px,stroke-dasharray: 1