在下面的示例中,
# keep the continuous var and the two categorical variables
select(trt, age, grade) %>%
group_nest(grade) %>%
mutate(
tbl = map2(
grade, data,
~tbl_summary(.y, by = trt,
label = list(age = paste("Age: Grade", .x)), missing = "no")
)
) %>%
pull(tbl) %>%
tbl_stack() %>%
as_tibble()
每个年龄的观察次数:年级应该在哪里添加?