I want to combine three table strata table summary objects. You can't merge them with the tbl_merge function. What can I do?
I have three tables like this:
table_one <- data %>%
select(Var1m, Var2, Var3, Var4, Var5, Var6, Var7) %>%
tbl_strata(
strata = Var7,
.tbl_fun =
~ .x %>%
tbl_summary(by = Var6, missing = "no") %>%
add_p(),
.header = "**{strata}**, N = {n}"
)
The library is the gt_summary library. The goal is to have all Characteristics for the variables once on the left and then table one with the two groups, table two with the two groups and three with the groups next to each other in one table. Here ist a pictore of what I'm trying to achieve:
I'm not sure what I'm missing. I tried the svryr library combine() function, transforming the tables into dfs and then combining.. combining by bind_rows
Any help is greatly appreciated!