m <- matrix(c(0.99, 0.0035, 0.0055, 0.0010,
0, 0.9900, 0.0052, 0.0048,
0, 0, 0.9960, 0.0040,
0, 0, 0, 1),
nrow = 4, byrow = TRUE)
## use as function (if you don't use TrialSimulator for simulation)
dat <- CorrelatedPfsAndOs4(1e4, m, 365 * 3)
## use as generator (if you use TrialSimulator for simulation)
ep <- endpoint(name = c('pfs', 'os', 'or'),
type = c('tte', 'tte', 'tte'), ## OR is TTE, not binary
generator = CorrelatedPfsAndOs4,
transition_probability = m,
duration = 365 * 3,
death_name = 'os', ## rename output from generator to match with "name"
progression_name = 'pfs',
response_name = 'or')
ep # run it in console to see summary report
Run the code above in your browser using DataLab