# Simulate trial data
trial_data <- sim_pw_surv()
# Cut after 150 events
trial_data_cut <- cut_data_by_event(trial_data, 150)
# Create a cutting test function that can be used by sim_gs_n()
regular_logrank_test <- create_test(wlr, weight = fh(rho = 0, gamma = 0))
# Test the cutting
regular_logrank_test(trial_data_cut)
# The results are the same as directly calling the function
stopifnot(all.equal(
regular_logrank_test(trial_data_cut),
wlr(trial_data_cut, weight = fh(rho = 0, gamma = 0))
))
Run the code above in your browser using DataLab