Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ...)?

like image 342
Martin Preusse Avatar asked Aug 25 '11 09:08

Martin Preusse


People also ask

How do you correct p-values for multiple comparisons?

The simplest way to adjust your P values is to use the conservative Bonferroni correction method which multiplies the raw P values by the number of tests m (i.e. length of the vector P_values).

Why are p-values adjusted for multiple comparisons?

Classicists believe that if multiple measures are tested in a given study, the p-value should be adjusted upward to reduce the chance of incorrectly declaring a statistical significance [4–7].

How do you correct p-values on Bonferroni?

To perform a Bonferroni correction, divide the critical P value (α) by the number of comparisons being made. For example, if 10 hypotheses are being tested, the new critical P value would be α/10. The statistical power of the study is then calculated based on this modified P value.

How do you correct multiple comparison correlation?

One standard approach to correct for multiple comparisons is simply to divide the target false positive rate (typically . 05) by the number of comparisons. Thus, if I'm conducting 5 tests, I would require each test to be significant at . 05/5, or p < .


3 Answers

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

like image 153
yuk Avatar answered Oct 05 '22 08:10

yuk


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.

like image 30
Fraukje Avatar answered Oct 05 '22 09:10

Fraukje


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.

like image 42
faken Avatar answered Oct 05 '22 08:10

faken