simulate_trial | R Documentation |
Simulate a single- or two-arm clinical trial, where end of study (EOS)
is triggered after a number of events has been observed or a certain time
has elapsed. Whereas simulate_arm
provides complete data for patients,
including time to event and loss of follow-up, simulate_trial
mimicks
an actual survival study by providing only the observed time (minimum of time
to event or censoring) and censoring indicator.
simulate_trial(arm0 = NA, arm1 = NA, events = NA, duration = Inf)
arm0 |
object of class 'arm'. |
arm1 |
object of class 'arm'. |
events |
number of required events to trigger end of study; overrides
study duration defined within |
duration |
time from first-patient-in to trigger end of study; overrides
study duration defined within |
arm |
0= |
time.accr |
time to accrual |
time.obs |
time to observation from accrual |
time.total |
time to observation from start of study |
censor |
0=censor, 1=event |
reason |
event description ('[experience ]event', '[loss to ]followup', 'administration[ censoring]') |
simulate_arm
for simulating complete data for a single
arm, create_arm
for creating an object of class 'arm'.
arm0 <- create_arm(size=120, accr_time=6, surv_scale=0.05, loss_scale=0.005, follow_time=12)
arm1 <- create_arm(size=120, accr_time=6, surv_scale=0.03, loss_scale=0.005, follow_time=12)
simulate_trial(arm0, duration=10)
simulate_trial(arm0, arm1, events=50)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.