MSKCC-Epi-Bio/bstfun

tbl_cross thoughts

ddsjoberg opened this issue · 3 comments

@karissawhiting I have been using tbl_cross() and it's great! Let's discuss a couple of items whenever we get a chance

library(bstfun)

trial[c("response", "trt")]  %>%
  tbl_cross(
    statistic = "{n} ({p}%)",
    test = "fisher.test",
  )

image

  1. I changed the statistic and the default percentage that was reported is a column percent. If i were in any other cross tab function, i think the default would be cell, right?
  2. The footnote about the p-value is taken from tbl_summary, but we should update the phrasing to be more in line with a cross tab

@ddsjoberg

  1. Yes, agree a more sensible default would be a cell percent instead of a column. This is an easy change I can make.

  2. Is it the "statistical tests performed" part that seems off? Maybe we can just remove that and only provide the text after the ":"?

@karissawhiting yeah, that is what I was thinking too re: the second point.

The other thing that I am not sure what to do with...if we move tbl_cross() to gtsummary, it should have reasonable output for both gt and kable. I think it's still readable without the spanning header, but a kable user would have no way of getting at the p-value at the moment. Let's think on it and revisit soon. Perhaps keeping in the p-value where is it in tbl_summary() is ok? idk

We settled on having p-val display as a column as it does in tbl_summary() by default. This will be more in line with {gtsummary}. I will also add a new argument called pvalue_source_note. This arg will be FALSE by default but will allow you to hide the p-val column and display the p-val in source note when TRUE (only when gt printer is used).