Adjusts supplied p-values for multiple comparisons via a specified method.
The method
parameter can be one of the following values:
By default, the number of comparisons for which the p-values should be corrected is equal to the number of provided p-values. Alternatively, it is possible to set comparisons
to a number greater than the length of pvals
. In that case, the methods assume comparisons - pvals.length
unobserved p-values that are greater than all observed p-values (for Holm's method and the Bonferroni correction) or equal to 1
for the remaining methods.
correction method
number of comparisons (default: pvals.length)
array containing the corrected p-values
var pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ];
var out = padjust( pvalues, 'bonferroni' );
// returns [ 0.04, 0.15, ..., 1, 1 ]
var pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ];
var out = padjust( pvalues, 'by' );
// returns [ ~0.091, ~0.171, ..., 1, ~0.571 ]
var pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ];
var out = padjust( pvalues, 'bh' );
// returns [ 0.04, 0.075, ..., 0.6, 0.25 ]
var pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ];
var out = padjust( pvalues, 'holm' );
// returns [ 0.04, 0.12, ..., 0.6, 0.4 ]
var pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ];
var out = padjust( pvalues, 'hommel' );
// returns [ 0.032, 0.12, ..., 0.6, 0.4 ]
Correction method.