cut_data_by_date: Cut a dataset for analysis at a specified date

View source: R/cut_data_by_date.R

cut_data_by_dateR Documentation

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)

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.

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.

Examples

# 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)

Merck/simtrial documentation built on April 14, 2025, 5:37 a.m.