Hopefully, a simple answer that someone knows off the top of their head!
I am using tbl_summary
and trying to modify my header to have n(%) instead of the standard format of N = 57. I would normally use modify_header(stat_by)
but can't when by
isn't included.
Example:
trial %>%
select(trt, marker, stage) %>%
tbl_summary() %>%
modify_header(stat_by = "**{level}**, n(%)")
Any ideas most appreciated!
To edit the text of your header, you can use the
update
argument inmodify_header()
.stat_0
refers to the statistic column, so this is the one you need to change:You can use {glue} syntax if you want to insert a statistic as well:
Good luck!