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

Add RMST test #188

Closed LittleBeannie closed 7 months ago

LittleBeannie commented 7 months ago

Closes #16

LittleBeannie commented 7 months ago

The current rmst() function asks users to input the variable name of the tte ("time"), event indicator ("status"), grouping variable ("sex"), such as

lung |> 
  rmst(var_label_tte = "time",
       var_label_event = "status",
       var_label_group = "sex",
       tau = 10,
       reference = "female")

By mimic the survival R package, a better syntax may be

rmst(Surv(time, status) ~ sex, data = lung)

Any suggestions/comments?

References: survdiff(Surv(time, status) ~ sex, data = lung)

LittleBeannie commented 7 months ago

Nice. I rearranged the order of functions in rmst.R to put the exported functions first and then followed the call sequence, as recommended by the tidyverse style guide:

In a file that contains multiple functions, public functions and their documentation should appear first, with private functions appearing after all documented functions.

Can you please fix the following (small) issues before we merge? Thanks.

  1. df is defined in one_rmst() but not actually used. Can this be removed or is it intended to be used?
  2. The description of "A list of 3 data frames of RMST calculations (RMST, RMSTDIFF, ALL)" does not match the implementation.
  3. What does the "std" mean in "Variance, std, and CIs of the estimated RMST"? Maybe rephrase to make it clear.

Hello @nanxstats , thank you for these valuable comments! I have addressed them in my latest commits. Please take a moment to review them and let me know if they are clear to you. Thank you!