Cut Off Functions
Functions
cut_off_none()
: No cut off is specifiedcut_off_after_first()
: Cut off attime
after first enrolled patientcut_off_after_last()
: Cut off attime
after 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: 0x5568ee3a2168>
#> <environment: 0x5568ee39e4c0>
#>
#> 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: 0x5568ee335230>
#> <environment: 0x5568ee332c10>
#>
#> 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: 0x5568e9358318>
#> <environment: 0x5568e9355188>
#>
#> 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: 0x5568e905f190>
#> <environment: 0x5568e905d120>
#>
#> Slot "label":
#> Cut off after 20 events
#>