We will use the cadtte data set from the random.cdisc.data package for the time-to-event summary table. We start by filtering the adtte data set for the overall survival observations, converting time of overall survival to months, creating new variables for event and non-event information and binarizing the ARM variable.
This time-to-event summary table splits the columns by treatment arm using split_cols_by(), creates a summary for patients with and without event using summarize_vars(), summarizes survival time using surv_time() and summarizes the analysis from unstratified Cox Proportional Hazards models using coxph_pairwise().
CTRL TRT
(N=134) (N=266)
——————————————————————————————————————————————————————————————
Patients with event (%) 58 (43.3%) 127 (47.7%)
Patients without event (%) 76 (56.7%) 139 (52.3%)
Time to Event (months)
Median NA NA
95% CI (9.4, NA) (9.2, NA)
25% and 75%-ile 5.6, NA 5.4, NA
Range 0.9 to 16.3 {1} 0.5 to 16.4 {1}
Unstratified Analysis
p-value (log-rank) 0.4068
Hazard Ratio 1.14
95% CI (0.84, 1.56)
——————————————————————————————————————————————————————————————
{1} - Censored observation: range maximum
——————————————————————————————————————————————————————————————
---title: TET1subtitle: Time-to-Event Summary Tablescategories: [TET]---------------------------------------------------------------------------::: panel-tabset{{< include setup.qmd >}}## TableThis time-to-event summary table splits the columns by treatment arm using `split_cols_by()`, creates a summary for patients with and without event using `summarize_vars()`, summarizes survival time using `surv_time()` and summarizes the analysis from unstratified Cox Proportional Hazards models using `coxph_pairwise()`.```{r}lyt <-basic_table() %>%split_cols_by(var ="ARM_BIN",ref_group ="CTRL" ) %>%add_colcounts() %>%analyze_vars(vars ="is_event",.stats ="count_fraction",.labels =c(count_fraction ="Patients with event (%)"),nested =FALSE,show_labels ="hidden" ) %>%analyze_vars(vars ="is_not_event",.stats ="count_fraction",.labels =c(count_fraction ="Patients without event (%)"),nested =FALSE,show_labels ="hidden" ) %>%surv_time(vars ="AVAL",var_labels ="Time to Event (months)",is_event ="is_event",table_names ="time_to_event" ) %>%coxph_pairwise(vars ="AVAL",is_event ="is_event",var_labels =c("Unstratified Analysis"),control =control_coxph(pval_method ="log-rank"),table_names ="coxph_unstratified" )build_table(lyt, adtte)```{{< include ../../misc/session_info.qmd >}}:::