Adjust for multiple hypothesis testing after performing statistical tests using dcTest. This can be performed using a method provided by the users. p.adjust is used by default.

dcAdjust(dcpvals, f = stats::p.adjust, ...)

Arguments

dcpvals

a matrix, the result of the dcTest function. The results should be passed as produced by the function and not modified in intermediate steps

f

a function, the function to be used for adjustment. p.adjust from the stats package is the default with the specific adjustment method 'fdr' used. The range of available methods can be accessed using p.adjust.methods. Custom functions should accept a numeric vector of p-values as the first argument

...

additional parameters to the adjustment function such as method

Value

a matrix, of adjusted p-values (or scores in the case of DiffCoEx and EBcoexpress) representing significance of differential associations.

Details

Ensure that the p-value matrix passed to this function is the one produced by dcTest. Any modification to the result matrix will result in failure of the function.

This method applies the adjustment method only to one triangle of the matrix to ensure adjustment is not performed for duplicated tests (symmetric matrix). As results from the DiffCoEx and EBcoexpress do not produce p-values, this method does not change anything thereby returning the original matrix.

See also

Examples

x <- matrix(rnorm(60), 2, 30)
cond <- rep(1:2, 15)
zscores <- dcScore(x, cond)
pvals <- dcTest(zscores, emat = x, condition = cond)
dcAdjust(pvals, p.adjust, method = 'fdr')
#>           1         2
#> 1        NA 0.6520118
#> 2 0.6520118        NA
#> attr(,"cor.method")
#> [1] "pearson"
#> attr(,"call")
#> z.score(emat = emat, condition = condition)
#> attr(,"dc.method")
#> [1] "zscore"
#> attr(,"dc.test")
#> [1] "two tailed z-test (adj)"