Cut Off Functions
Functions
cut_off_none(): No cut off is specifiedcut_off_after_first(): Cut off attimeafter first enrolled patientcut_off_after_last(): Cut off attimeafter last enrolled patientcut_off_after_events(): Cut off after the time of the n-th event
Examples
cut_off_none()
#> An object of class "DataSimCutOff"
#> Slot "fun":
#> function (data)
#> {
#> data
#> }
#> <bytecode: 0x555bae7fd230>
#> <environment: 0x555bae7fd3b8>
#>
#> Slot "label":
#> [1] "No cut off"
#>
cut_off_after_first(time = 36)
#> An object of class "DataSimCutOff"
#> Slot "fun":
#> function (data)
#> {
#> cut_time <- min(data$enrollment) + time
#> after_cut_off <- data$enrollment + data$eventtime > cut_time
#> data$status <- ifelse(after_cut_off, 0, data$status)
#> data$eventtime <- ifelse(after_cut_off, cut_time - data$enrollment,
#> data$eventtime)
#> data[data$enrollment < cut_time, ]
#> }
#> <bytecode: 0x555bae76f130>
#> <environment: 0x555bae76cb10>
#>
#> Slot "label":
#> Cut off after first enrolled patient reaches time = 36
#>
cut_off_after_last(time = 36)
#> An object of class "DataSimCutOff"
#> Slot "fun":
#> function (data)
#> {
#> cut_time <- max(data$enrollment) + time
#> after_cut_off <- data$enrollment + data$eventtime > cut_time
#> data$status <- ifelse(after_cut_off, 0, data$status)
#> data$eventtime <- ifelse(after_cut_off, cut_time - data$enrollment,
#> data$eventtime)
#> data
#> }
#> <bytecode: 0x555bae514860>
#> <environment: 0x555bae515e78>
#>
#> Slot "label":
#> Cut off after last enrolled patient reaches time=36
#>
cut_off_after_events(n = 20)
#> An object of class "DataSimCutOff"
#> Slot "fun":
#> function (data)
#> {
#> data_s1 <- data[data$status == 1, ]
#> cut_time <- min(sort(data_s1$enrollment + data_s1$eventtime)[n],
#> Inf, na.rm = TRUE)
#> after_cut_off <- data$enrollment + data$eventtime > cut_time
#> data$status <- ifelse(after_cut_off, 0, data$status)
#> data$eventtime <- ifelse(after_cut_off, cut_time - data$enrollment,
#> data$eventtime)
#> data[data$enrollment < cut_time, ]
#> }
#> <bytecode: 0x555bae492610>
#> <environment: 0x555bae4905a0>
#>
#> Slot "label":
#> Cut off after 20 events
#>