Supress table header in tbl regression of gtsummary

0 votes

Update to clarify and show intention:

The related question is here tbl_merge: sort variables alphabetically in merged tbl_regression models {gtsummary} and @Daniel D. Sjoberg already provided the correct and professional answer.

But I want to try if this is possible:

x <- tbl_merge(list(t1, t2, t3 ,t4))

y <- x %>% 
  tbl_split(variables = c(age, ttdeath, response, death, stage, grade)) 

With this code I split the table into one row tables:

y[[1]]

enter image description here

y[[2]]

enter image description here

and so on.....

Now: I want to remove each footnote and header and merge them in a defined order together. In essence it is the reversal of spliting?!

Thanks for your time and energy!

First question:

With the tbl_regression() function from gtsummary we can make a table.

By adding modify_footnote(everything() ~ NA, abbreviation = TRUE) we can omit footnotes.

like here: from:supress confidence interval footnote in tbl_regression

library(dplyr)
library(gtsummary)

my_table <-
  lm(mpg ~ disp, mtcars) %>%
  tbl_regression(exponentiate = FALSE) %>%
  modify_footnote(everything() ~ NA, abbreviation = TRUE)
my_table

Result:

enter image description here

My question:

How can I remove the header part of this table to get this output:

enter image description here

If possible it should be possible with modify_header or modify_table_styling()?!

There is a rationale behind.

The ultimate goal is to split each element of a gtsummary table Split long gtsummary() table to n smaller tables and rearrange them in a given order tbl_merge: sort variables alphabetically in merged tbl_regression models {gtsummary}

Mar 14, 2022 in Machine Learning by Nandini
• 5,480 points
594 views

1 answer to this question.

0 votes

After you've separated your table, use tbl stack to reassemble it with tbl_stack(). There's no need to stress about the headers and footnotes; they'll take care of themselves tbl_stack(list(y[[2)]], y[[1)]]). 

After you've separated your table, use tbl stack to reassemble it with tbl_stack(). There's no need to stress about the headers and footnotes; they'll take care of themselves tbl_stack(list(y[[2)]], y[[1)]]). 

You can also try using the huxtable backend, here's a simple method:

header <- as_hux_table(my_table)
header <- header[2,] # just row 2 # 

and to bind multiple huxtables together, do e.g. 

rbind(header, header2, header3)

After that, you can use huxtable functions to adjust the style as needed.

answered Mar 17, 2022 by Dev
• 6,000 points

Related Questions In Machine Learning

+1 vote
0 answers

text mining new set of data in production environment expect training feature

Hi, I have trained a model based on ...READ MORE

Nov 28, 2019 in Machine Learning by MANOJ
• 130 points
630 views
0 votes
3 answers

What are some best examples of AI applications in our daily life?

Hi Michael, You don’t need to be a ...READ MORE

answered Apr 9, 2020 in Machine Learning by Albert
• 160 points
1,792 views
0 votes
1 answer

Role of the bias in neural networks.

Hi@akhtar, The activation function in Neural Networks takes ...READ MORE

answered Jul 15, 2020 in Machine Learning by MD
• 95,440 points
1,264 views
0 votes
1 answer

Big Data transformations with R

Dear Koushik, Hope you are doing great. You can ...READ MORE

answered Dec 18, 2017 in Data Analytics by Sudhir
• 1,610 points
768 views
0 votes
2 answers

Transforming a key/value string into distinct rows in R

We would start off by loading the ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,660 points
844 views
0 votes
1 answer

Finding frequency of observations in R

You can use the "dplyr" package to ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,660 points
5,551 views
0 votes
1 answer

Left Join and Right Join using "dplyr"

The below is the code to perform ...READ MORE

answered Mar 27, 2018 in Data Analytics by Bharani
• 4,660 points
860 views
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP