Learn R Programming

simtrial (version 1.0.0)

cut_data_by_date: Cut a dataset for analysis at a specified date

Description

Cut a dataset for analysis at a specified date

Usage

cut_data_by_date(x, cut_date)

Value

A data frame ready for survival analysis, including columns time to event (tte), event, the stratum, and the treatment. The class of the data frame is tte_data, and the attribute ratio generated by sim_pw_surv() is also attached.

Arguments

x

A time-to-event dataset, for example, generated by sim_pw_surv().

cut_date

Date relative to start of randomization (cte from input dataset) at which dataset is to be cut off for analysis.

Examples

Run this code
# Use default enrollment and event rates and
# cut at calendar time 5 after start of randomization
sim_pw_surv(n = 20) |> cut_data_by_date(5)

Run the code above in your browser using DataLab