event_free {junco} | R Documentation |
Workaround statistics function to time point survival estimate with CI
Description
This is a workaround for tern::s_surv_timepoint()
, which adds a statistic
containing the time point specific survival estimate together with the
confidence interval.
Usage
a_event_free(
df,
.var,
...,
.stats = NULL,
.formats = NULL,
.labels = NULL,
.indent_mods = NULL
)
s_event_free(
df,
.var,
time_point,
time_unit,
is_event,
percent = FALSE,
control = control_surv_timepoint()
)
Arguments
df |
( |
.var |
( |
... |
additional arguments for the lower level functions. |
.stats |
( |
.formats |
(named |
.labels |
(named |
.indent_mods |
(named |
time_point |
( |
time_unit |
( |
is_event |
( |
percent |
( |
control |
( |
Value
for s_event_free
, a list as returned by the tern::s_surv_timepoint()
with an additional three-dimensional statistic event_free_ci
which
combines the event_free_rate
and rate_ci
statistics.
For a_event_free
, analogous to tern::a_surv_timepoint but with the additional
three-dimensional statistic described above available via .stats
.
Functions
-
a_event_free()
: Formatted analysis function which is used asafun
. -
s_event_free()
: Statistics function which works liketern::s_surv_timepoint()
, the difference is that it returns the additional statisticevent_free_ci
.
Examples
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"
)