1

Let's consider the example below.

m1 <- glm(response ~ age + stage, trial, family = binomial)
tbl_regression(m1, exponentiate = TRUE)

enter image description here

As shown in the image (excuse me for sloppy handwriting), I'd like to add footnote specifically for certain variables. My intinct is to

m1 <- glm(response ~ age + stage, trial, family = binomial)
tbl_regression(m1, exponentiate = TRUE) %>%
modify_footnote(T1 = "ABCDE")

But this doesn't work, and looking at available variables to modify:

tbl_regression(m1, exponentiate = TRUE) %>%
show_header_names()

shows only

 As a usage guide, the code below re-creates the current column headers.
modify_header(
  label = "**Characteristic**",
  estimate = "**OR**",
  ci = "**95% CI**",
  p.value = "**p-value**"
)


Column Name   Column Header      
------------  -------------------
label         **Characteristic** 
estimate      **OR**             
ci            **95% CI**         
p.value       **p-value**    

which means there's no variable to modify, not headers. Is there any way to achieve this?

Edit: I'd like to specifically "link" the foornote to "T1" in the figure by showing superscript, as shown in the expected figure (i.e. T1 a in the figure, a T1 = ABCDE, in the footnote)

r_noobie
  • 127
  • 6
  • I'm so sorry, I have found a way to do this here: https://stackoverflow.com/questions/73154658/adding-a-footnote-to-a-single-row-label-in-a-gtsummary-table – r_noobie Nov 25 '22 at 01:27

1 Answers1

1

Convert to gt table and then modify accordingly. Hope this helps.

tbl_regression(m1, exponentiate = TRUE) %>%
  as_gt() %>%
  tab_footnote(
    footnote = "T1=abcde")

chris jude
  • 467
  • 3
  • 8
  • Thank you for the answer! However I'd like to "link" it to "T1" in the figure by showing superscript, as shown in the expected figure (i.e. "T1a<\sup>" in the figure, and "a<\sup> T1 = ABCDE" in the footnote. Is there a way to do this? – r_noobie Nov 25 '22 at 00:59
  • Sorry typos: (i.e. T1 a in the figure, and a T1 = ABCDE in the footnote) – r_noobie Nov 25 '22 at 01:09