I want to output the results of the wonderful gtsummary package for tbl_uvregression
by groups.
library(gtsummary)
conflict_prefer("trial", "gtsummary")
trial %>%
group_by(grade) %>%
select(response, age) %>%
tbl_uvregression(
method = glm,
y = response,
method.args = list(family = binomial),
exponentiate = TRUE,
pvalue_fun = ~style_pvalue(.x, digits = 2)
) %>%
add_global_p() %>% # add global p-value
add_nevent() %>% # add number of events of the outcome
add_q() %>% # adjusts global p-values for multiple testing
bold_p() %>% # bold p-values under a given threshold (default 0.05)
bold_p(t = 0.10, q = TRUE) %>% # now bold q-values under the threshold of 0.10
bold_labels()
This produces an error:
Adding missing grouping variables: grade
Can anyone help? Thank you very much