Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding the data_simulation.Rmd file #280

Open
3 tasks
zhiiiyang opened this issue Mar 27, 2024 · 0 comments
Open
3 tasks

Regarding the data_simulation.Rmd file #280

zhiiiyang opened this issue Mar 27, 2024 · 0 comments

Comments

@zhiiiyang
Copy link

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_dist function. 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.

    exponential_dist <- create_event_dist(dist = "exponential", lambda = 1 / 24)

  • remove the lines associated with external control in the section " Using fixed external data"

    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_events described in cut off after events #279

    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_constant function in earlier sections so I think the additional texts are not needed then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant