Skip to contents

cutDataAtCount takes a time-to-event data set and cuts the data at which an event count is reached.

Usage

cutDataAtCount(x, count)

Arguments

x

a time-to-event dataset, e.g., generated by simPWSurv

count

event count at which data cutoff is to be made

Value

a tibble ready for survival analysis, including culumns time to event (tte), event, the stratum and the treatment.

Examples

library(tidyr)
# Use default enrollment and event rates at cut at 100 events
x <- simPWSurv(n = 200) %>% cutDataAtCount(100)
table(x$event, x$Treatment)
#>    
#>     Control Experimental
#>   0      40           55
#>   1      57           43