Learn R Programming

RastaRocket (version 1.0.2)

add_pvalues: Add p-values and separate footnotes to a gtsummary object

Description

This function adds p-values to a gtsummary table using the specified tests and separates the p-value footnotes.

Usage

add_pvalues(res, tests)

Value

A gtsummary table object with p-values added and footnotes separated.

Arguments

res

A gtsummary table object.

tests

A list of tests to pass to gtsummary::add_p(), or TRUE to use default tests.

Examples

Run this code
library(gtsummary)
tbl <- trial %>% tbl_summary(by = trt)
tbl <- add_pvalues(tbl, tests = TRUE)

Run the code above in your browser using DataLab