Skip to contents

[Questioning]
The usual presentation of footnotes for p-values on a gtsummary table is to have a single footnote that lists all statistical tests that were used to compute p-values on a given table. The separate_p_footnotes() function separates aggregated p-value footnotes to individual footnotes that denote the specific test used for each of the p-values.

Usage

separate_p_footnotes(x)

Arguments

x

(tbl_summary, tbl_svysummary)
Object with class "tbl_summary" or "tbl_svysummary"

Examples

# Example 1 ----------------------------------
trial |>
  tbl_summary(by = trt, include = c(age, grade)) |>
  add_p() |>
  separate_p_footnotes()
Characteristic Drug A
N = 98
1
Drug B
N = 102
1
p-value
Age 46 (37, 60) 48 (39, 56) 0.72
    Unknown 7 4
Grade

0.93
    I 35 (36%) 33 (32%)
    II 32 (33%) 36 (35%)
    III 31 (32%) 33 (32%)
1 Median (Q1, Q3); n (%)
2 Wilcoxon rank sum test
3 Pearson’s Chi-squared test