My question can be conceptualized using the same sample data used for the tbl_summary trial dataset from the tutorial here: https://www.danieldsjoberg.com/gtsummary/articles/tbl_summary.html.
How would I calculate the mortality rate based on grade of tumor instead of calculating the incidence of grade I-III tumors? So far as I can find, there is not a way to calculate a custom statistic based on a third column, which is essentially what I am trying to do.
--- Edit ---
My input data has 3 columns - stent_type, success, stent_30. stent_type is either a category 0 or 1, success is either a 0 or 1, and stent_30 is either a 0 or 1 (basically was the stent placed before or after 30 days). I would like to create a 2x3 table with the percent/number of successfully placed stents for category 0 or 1 stents, along with a p-value comparing the two columns for stent_30. Something like this:
| Stent < 30 | Stent > 30 | p-value | |
|---|---|---|---|
| stent 0 | 75%(10) | 70% (9) | 0.1 |
| stent 1 | 50% (6) | 40% (2) | 0.05 |
I'm basically having trouble because I'm not sure how to summarize a category based on 2 different categories (if that makes sense?)