'Adjust p-values for multiple comparisons in Matlab

I have a cell array of p-values that have to be adjusted for multiple comparisons. How can I do that in Matlab? I can't find a built-in function.

In R I would do:

data.pValue_adjusted = p.adjust(data.pValue, method='bonferroni')

Is there a similiar function for Matlab? Ideally one that performs different adjustment methods (Bonferroni, Benjamini-Hochberg, FDR ...)?



Solution 1:[1]

If you have Bioinformatics Toolbox, you can use MAFDR function to calculate p-values adjusted by False Discovery Rate.

Solution 2:[2]

For people without the Bioinformatics Toolbox, the FDR (False Discovery Rate) method is also very nicely described here, it also provides a link with an fdr script.

Solution 3:[3]

A MATLAB/Octave implementation of R's p.adjust function is available here. It can perform p-value adjustment for multiple comparisons with the following methods, equivalent to their R counterparts:

  • Holm
  • Hochberg
  • Hommel
  • Bonferroni
  • BH
  • BY
  • fdr
  • Sidak (this one is not available in the R function)

Disclaimer: I'm the author of this package.

Solution 4:[4]

Have a look at T-test with Bonferroni Correction and related files in the Matlab File-exchange.

I hope this helps.

Solution 5:[5]

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 yuk
Solution 2 Fraukje
Solution 3 faken
Solution 4 ephsmith
Solution 5 Jan Schnupp