sort_filter_p: Sort/filter by p-values

sort_filter_pR Documentation

Sort/filter by p-values

Description

Sort/filter by p-values

Usage

sort_p(x, q = FALSE)

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

Arguments

x

(gtsummary)
An object created using gtsummary functions

q

(scalar logical)
When TRUE will check the q-value column rather than the p-value. Default is FALSE.

t

(scalar numeric)
Threshold below which values will be retained. Default is 0.05.

Author(s)

Karissa Whiting, Daniel D. Sjoberg

Examples

# Example 1 ----------------------------------
trial %>%
  select(age, grade, response, trt) %>%
  tbl_summary(by = trt) %>%
  add_p() %>%
  filter_p(t = 0.8) %>%
  sort_p()

# Example 2 ----------------------------------
glm(response ~ trt + grade, trial, family = binomial(link = "logit")) %>%
  tbl_regression(exponentiate = TRUE) %>%
  sort_p()

ddsjoberg/gtsummary documentation built on June 11, 2025, 10:29 p.m.