-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Hi, I have a few thoughts about improving the vignette data_simulation.Rmd file for your consideration.
-
add some texts to explain how to convert median survival time to lambda in the
create_event_distfunction. It would be something like lambda is equal to log(2)/median survival time, e.g., if survival time is equal to 24 months, lambda is set to be log(2)/24.psborrow2/vignettes/data_simulation.Rmd
Line 213 in 5123a8c
exponential_dist <- create_event_dist(dist = "exponential", lambda = 1 / 24) -
remove the lines associated with external control in the section " Using fixed external data"
psborrow2/vignettes/data_simulation.Rmd
Lines 582 to 600 in 5123a8c
my_data_sim_setup_with_fixed <- create_data_simulation( baseline = my_internal_baseline, coefficients = c(age = 0.001, score_high = 1.1), event_dist = create_event_dist(dist = "exponential", lambdas = 1 / 50), fixed_external_data = historical_trial_data ) %>% set_enrollment( internal = enrollment_constant(rate = c(25, 10), for_time = c(4, 30)), external = enrollment_constant(rate = c(30, 10), for_time = c(4, 30)) ) %>% set_dropout( internal_treated = create_event_dist(dist = "exponential", lambdas = 1 / 50), internal_control = create_event_dist(dist = "exponential", lambdas = 1 / 55), external_control = create_event_dist(dist = "exponential", lambdas = 1 / 40) ) %>% set_cut_off( internal = cut_off_after_first(time = 60), external = cut_off_after_events(n = 100) ) -
only count the number of events for
cut_off_after_eventsdescribed in cut off after events #279
Line 328 in 5123a8c
cut_time <- sort(data$enrollment + data$eventtime)[n] -
Using a cutoff value to dichotomize a continuous variable to a binary variable is not needed since it is pretty straightforward for users to do it instead.
-
I just noticed that you have introduced
enrollment_constantfunction in earlier sections so I think the additional texts are not needed then.