Sort and filter variables in table by p-values

sort_p(x, q = FALSE)

filter_p(x, q = FALSE, t = 0.05)

Arguments

x

An object created using gtsummary functions

q

Logical argument. When TRUE will the q-value column is used

t

p-values/q-values less than or equal to this threshold will be retained. Default is 0.05

Example Output

Example 1

Example 2

Author

Karissa Whiting, Daniel D. Sjoberg

Examples

# 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()