Sort and filter variables in table by p-values
sort_p(x, q = FALSE)
filter_p(x, q = FALSE, t = 0.05)
An object created using gtsummary functions
Logical argument. When TRUE
will the q-value column is used
p-values/q-values less than or equal to this threshold will be retained. Default is 0.05
Example 1
Example 2
# \donttest{
# Example 1 ----------------------------------
sort_filter_p_ex1 <-
trial %>%
select(age, grade, response, trt) %>%
tbl_summary(by = trt) %>%
add_p() %>%
filter_p(t = 0.8) %>%
sort_p()
# Example 2 ----------------------------------
sort_p_ex2 <-
glm(response ~ trt + grade, trial, family = binomial(link = "logit")) %>%
tbl_regression(exponentiate = TRUE) %>%
sort_p()
# }