sort_filter_p | R Documentation |
Sort and filter variables in table by p-values
sort_p(x, q = FALSE)
filter_p(x, q = FALSE, t = 0.05)
x |
An object created using gtsummary functions |
q |
Logical argument. When |
t |
p-values/q-values less than or equal to this threshold will be retained. Default is 0.05 |
Example 1
Example 2
Karissa Whiting, Daniel D. Sjoberg
# 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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.