Skip to contents
patient_data = sim_data |>
  dplyr::filter(.data$Category == "Patient")
table = sim_subtype_and_stage_table
tab1 <- table_subtype_by_demographics(
  patient_data, 
  table,
  demographic_vars = "Sex",
  footnotes_as_letters = FALSE) |> 
  gtsummary::as_flex_table(ref_symbols = letters)
tab1
Table 1: test

Characteristic

Overall
N = 18a

Subtype 1
N = 1a

Subtype 3
N = 17a

p-value

Sex, n (%)

1.000b

Female

9 (50%)

1 (100%)

8 (47%)

Male

9 (50%)

0 (0%)

9 (53%)

an (column %)

bGroup comparison was done by Fisher's exact test