adtte_f <- tern::tern_ex_adtte |>
dplyr::filter(PARAMCD == "OS") |>
dplyr::mutate(
AVAL = tern::day2month(AVAL),
is_event = CNSR == 0
)
basic_table() |>
split_cols_by(var = "ARMCD") |>
analyze(
vars = "AVAL",
afun = a_event_free,
show_labels = "hidden",
na_str = tern::default_na_str(),
extra_args = list(
time_unit = "week",
time_point = 3,
is_event = "is_event"
)
) |>
build_table(df = adtte_f)
adtte_f <- tern::tern_ex_adtte |>
dplyr::filter(PARAMCD == "OS") |>
dplyr::mutate(
AVAL = tern::day2month(AVAL),
is_event = CNSR == 0
)
s_event_free(
df = adtte_f,
.var = "AVAL",
time_point = 6,
is_event = "is_event",
time_unit = "month"
)
Run the code above in your browser using DataLab