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

Require a single formula syntax for rmst() #242

Closed jdblischak closed 4 months ago

jdblischak commented 4 months ago

Closes #220

Follow-up to #216

The formula argument of rmst() now requires a single syntax, Surv(tte, event) ~ group). However, to be consistent with user expectations, it is aware of the argument names of Surv(), so it is flexible enough to handle valid input such as Surv(event = event, tte) ~ group. Thanks to @nanxstats for the argument parsing code.

Below are examples of valid and invalid formulas:

# valid
Surv(tte, event) ~ group)
Surv(event = event, time = tte) ~ group)
Surv(tte, event = event) ~ group)
Surv(event = event, tte) ~ group)

# invalid
Surv(tte | event) ~ group)
~ Surv(tte, evntd, group)
tte ~ event + group
~ tte + event + group
jdblischak commented 4 months ago

Shall I merge it before I merge https://github.com/Merck/simtrial/pull/229?

Yes, you can. The two PRs are unrelated

nanxstats commented 4 months ago

You might want to merge this shortly after we release 0.4.1.