<div dir="ltr"><div><div>Kathrin is correct about the bug in FieldTrip's FDR function.<br></div>You can verify it yourself with Matlab's built in mafdr.m or this File Exchange Function<br><a href="https://www.mathworks.com/matlabcentral/fileexchange/27418-benjamini---hochberg-yekutieli-false-discovery-rate--fdr--control-procedure--fdr-bh-m-">https://www.mathworks.com/matlabcentral/fileexchange/27418-benjamini---hochberg-yekutieli-false-discovery-rate--fdr--control-procedure--fdr-bh-m-</a><br><br></div><div>For example, if you run:<br>raw_p=[.01 .01 .01 .6 .6 .6]; %uncorrected p-values<br><br>% Matlab's built-in function<br>sig_p=mafdr(p,'BHFDR',.05)<.05; % p-values signficant after Benjamini & Hochberg FDR adjustment<br>fprintf('mafdr significant p-values:\n');<br>disp(sig_p)<br><br>% FieldTrip's function<br>sig_pFT=fdr(p,.05); <br>fprintf('FieldTrip FDR significant p-values:\n');<br>disp(sig_pFT)<br><br></div><div>The first three p-values should be significant but FieldTrip's function only declares the 3rd p-value significant.<br></div><div><br></div><div>If you've used FieldTrip's FDR function you should fix the bug and re-run your analysis. You may have missed significant effects (though in practice missed p-values might actually be rare).<br></div><div>   -David<br><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 19, 2015 at 12:46 PM, Kathrin Müsch <span dir="ltr"><<a href="mailto:kathrin.muesch@gmail.com" target="_blank">kathrin.muesch@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><pre><font face="Helvetica">Hi,

I realized that the fdr.m file gives a wrong output for the case that the smallest p values are above the FDR threshold. This means that the smallest p-values might be rejected, whereas lower p-values could pass the test. I have filed it as a bug (#3008).</font></pre><pre><font face="Helvetica">The current script only declares the p-values below or equal to the threshold as significant, whereas in fact all p-values that are smaller or equal to the largest p-value below or equal to this threshold should be declared significant according to the original paper ("find the largest P value that is below the line [threshold]. All voxels with P values less than or equal to this are declared active.”).</font></pre><pre><font face="Helvetica">I assume that the following line is incorrect and should be replaced by the one below:</font></pre><pre><font face="Helvetica">Incorrect: h = (ps<=pi);</font></pre><pre><font face="Helvetica">Correct: h = ps<=(max(ps(ps<=pi)));

Cheers,
Kathrin</font></pre><div>
<div>--<br><blockquote type="cite" style="color:rgb(0,0,0)"><blockquote type="cite"></blockquote></blockquote>Kathrin Müsch, Ph.D.<br><blockquote type="cite" style="color:rgb(0,0,0)"><blockquote type="cite"></blockquote></blockquote>Department of Psychology<br>University of Toronto<br>Toronto, Canada<br><a href="http://www.honeylab.org" target="_blank">www.honeylab.org</a></div>
</div>
<br></div><br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>