cut_data_by_event: Cut a Dataset for Analysis at a Specified Event Count

View source: R/cutDataAtCount.R

cut_data_by_eventR Documentation

Cut a Dataset for Analysis at a Specified Event Count

Description

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

Usage

cut_data_by_event(x, count)

Arguments

x

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

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 <- sim_pw_surv(n = 200) %>% cut_data_by_event(100)
table(x$event, x$Treatment)


keaven/simtrial documentation built on April 17, 2023, 4:03 a.m.