demo table_subtype_by_demographics()
Source:vignettes/articles/demo-table-subtype-by-demographics.qmd
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()
tab1
Characteristic |
Overall |
Type 1 |
Type 2 |
p-value |
---|---|---|---|---|
Sex, n (%) |
1.0002 |
|||
Female |
9 (50%) |
8 (47%) |
1 (100%) |
|
Male |
9 (50%) |
9 (53%) |
0 (0%) |
|
1n (column %) | ||||
2Group comparison was done by Fisher's exact test |