Adjusts the p-values of a table for multiple comparisons with
stats::p.adjust() and adds them as a q.value column, with a footnote
naming the method.
Arguments
- x
(
ltsummary)
A table with ap.valuecolumn, e.g. fromadd_p()ortbl_regression().- method
(
string)
A method ofstats::p.adjust():"fdr"(the default),"holm","hochberg","hommel","bonferroni","BH","BY"or"none".- pvalue_fun
(
function)
Function that formats the q-values. Default is the function that formats the p-value column.
See also
Other add statistics:
add_ci(),
add_difference(),
add_difference_row(),
add_n(),
add_overall(),
add_p(),
add_p_continuous,
add_stat(),
add_stat_label(),
tests
Examples
# Example 1 ----------------------------------
trial |>
tbl_summary(by = trt, include = c(age, grade, response)) |>
add_p() |>
add_q()
# Example 2 ----------------------------------
glm(response ~ age + grade + trt, trial, family = binomial) |>
tbl_regression(exponentiate = TRUE) |>
add_global_p() |>
add_q(method = "bonferroni")