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
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()
| Characteristic |
Drug A
N = 98 |
Drug B
N = 102 |
p-value |
|---|
| Tumor Response |
28 (29%) |
33 (34%) |
0.5 |
| Unknown |
3 |
4 |
|
| Age |
46 (37, 60) |
48 (39, 56) |
0.7 |
| Unknown |
7 |
4 |
|
# Example 2 ----------------------------------
glm(response ~ trt + grade, trial, family = binomial(link = "logit")) %>%
tbl_regression(exponentiate = TRUE) %>%
sort_p()
| Characteristic |
OR |
95% CI |
p-value |
|---|
| Chemotherapy Treatment |
|
|
|
| Drug A |
— |
— |
|
| Drug B |
1.21 |
0.66, 2.24 |
0.5 |
| Grade |
|
|
|
| I |
— |
— |
|
| II |
0.94 |
0.44, 1.98 |
0.9 |
| III |
1.09 |
0.52, 2.27 |
0.8 |
| Abbreviations: CI = Confidence Interval, OR = Odds Ratio |