I am working on a project with gtsummary. For one of the tables, I have to build a long table listing covariables before and after the matchit process.
My issue is that for all of the covariables (Obesity, for example), it reads one row, Obesity, then next row, Obese, and then the next, Not Obese. That is three tables for which I wish to only show one: Diabetes N (%).
I have tried editing dichotomous variables, introducing Null
, trying to find a row_hide
function, but to no avail.
Here is my code:
Creation of trial
trialCAS1 <- index_CAS %>%
select(TopDecile, Gender, Obesity, Diabetes, Diabetes_Complex, etc)
Tbl summary
CAStable1 <- tbl_summary(trialCAS1,
by = TopDecile,
missing = "no") %>%
add_n() %>%
modify_header(label = "**Variable**") %>%
bold_labels()
I included the first table I get.