Define an arm in a trial. This is a user-friendly wrapper for
the class constructor Arm$new
. Users who are not familiar with
the concept of classes may consider using this wrapper directly.
Arguments
- name
name of arm, which is the arm's label in generated data
- ...
subset condition that is compatible with
dplyr::filter
. This can be used to specify inclusion criteria of an arm. By default it is not specified, i.e. all data generated by the generator specified in...
.
Examples
risk <- data.frame(
end_time = c(1, 10, 26.0, 52.0),
piecewise_risk = c(1, 1.01, 0.381, 0.150) * exp(-3.01)
)
pfs <- endpoint(name = 'pfs', type='tte',
generator = PiecewiseConstantExponentialRNG,
risk = risk, endpoint_name = 'pfs')
orr <- endpoint(
name = 'orr', type = 'non-tte',
readout = c(orr = 2), generator = rbinom,
size = 1, prob = .4)
placebo <- arm(name = 'pbo')
placebo$add_endpoints(pfs, orr)
placebo
#> ⚕⚕ Arm Name: pbo
#> ⚕⚕ # of Endpoints: 2
#> ⚕⚕ Registered Endpoints: pfs, orr
#> Summary generated.
head(placebo$get_endpoints()[[1]]$get_generator()(n = 1e3))
#> pfs pfs_event
#> 1 0.6959152 1
#> 2 52.0000000 0
#> 3 6.1084592 1
#> 4 52.0000000 0
#> 5 0.9167278 1
#> 6 7.0935809 1
placebo$get_endpoints()[[2]]$get_name()
#> [1] "orr"
## print summary reports for endpoint objects in console
# placebo