Skip to content

Regarding the data_simulation.Rmd file #280

Description

@zhiiiyang

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions