Learn R Programming

gtsummary (version 0.1.0)

add_q.fmt_table1: Add a column of q values to fmt_table1 object to account for multiple comparisons in Rmarkdown

Description

The adjustments to the p-values is performed with stats::p.adjust. The default method for correction is false discovery rate ("fdr")

Usage

# S3 method for fmt_table1
add_q(x, method = "fdr", pvalue_fun = fmt_pvalue,
  ...)

Arguments

x

table1 object

method

character argument. Methods from stats::p.adjust are accepted. Default is method = fdr.

pvalue_fun

function for rounding/formatting p-values. Default is fmt_pvalue.

...

further arguments passed to or from other methods

Examples

Run this code
# NOT RUN {
trial %>% fmt_table1(by = "trt") %>% add_comparison() %>% add_q()
# }

Run the code above in your browser using DataLab