create_test | R Documentation |
Create a cutting test function for use with sim_gs_n()
create_test(test, ...)
test |
A test function such as |
... |
Arguments passed to the cutting test function |
A function that accepts a data frame of simulated trial data and returns a test result
sim_gs_n()
, create_cut()
# 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))
))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.