Adjust P-values of a tidy_summary object

adjust_p(x, method)

# S3 method for tidy_summary
adjust_p(x, method = "BH")

Arguments

x

a tidy_summary object.

method

(chr, default = "BH") a valid method for p.adjust

Value

a tidy_summary object with the Ps adjusted

Examples

# \donttest{
  library(Hmisc)
#> 
#> Attaching package: ‘Hmisc’
#> The following objects are masked from ‘package:base’:
#> 
#>     format.pval, units
  my_summary <- summary(Species ~ ., data = iris,
    method = "reverse",
    test = TRUE
  )

  tidy_summary(my_summary, prtest = "P") %>%
    adjust_p()
#>  P adjusted with BH method.
#> # A tibble: 4 × 5
#>   `&nbsp;`     `setosa \n(N=50)`   `versicolor \n(N=50)` `virginica \n(N=50)`
#>   <chr>        <chr>               <chr>                 <chr>               
#> 1 Sepal.Length "4.800/5.000/5.200" "5.600/5.900/6.300"   "6.225/6.500/6.900" 
#> 2 Sepal.Width  "3.200/3.400/3.675" "2.525/2.800/3.000"   "2.800/3.000/3.175" 
#> 3 Petal.Length "1.400/1.500/1.575" "4.000/4.350/4.600"   "5.100/5.550/5.875" 
#> 4 Petal.Width  "   0.2/0.2/0.3"    "   1.2/1.3/1.5"      "   1.8/2.0/2.3"    
#> # ℹ 1 more variable: `P-value` <chr>
# }