A mistake in my False discovery rate (FDR) correction script

37 sec read

I have posted an FDR script at https://www.alivelearn.net/?p=1840. I noticed that there is a small bug. In rare cases, this bug will cause the most significant voxel to be classified as ‘non-significant’ while other voxels are ‘significant’.

Consider the following example:

p = [0.8147 0.9058 0.0030 0.9134 0.6324 0.0029 0.2785 0.5469 0.9575 0.9649 0.1576 0.9706 0.9572 0.4854 0.8003 0.1419 0.4218 0.9157];

The previous script will classify p(3) as significant but p(6) as non-significant.

Here is the updated version of the script:

function y = fdr0(p, q)
% y = fdr0(p, q)
%
% to calculate whether a pvalue survive FDR corrected q
%
% p: an array of p values. (e.g. p values for each channel)
% q: desired FDR threshold (typically 0.05)
% y: an array of the same size with p with only two possible values. 0
% means this position (channel) does not survive the threshold, 1 mean it
% survives
%
% Ref:
% Genovese et al. (2002). Thresholding statistical maps in functional
% neuroimaging using the false discovery rate. Neuroimage, 15:722-786.
%
% Example:
%   y = fdr0(rand(10,1),0.5);
%
% Xu Cui
% 2016/3/14
%

pvalue = p;
y = 0 * p;

[sortedpvalue, sortedposition] = sort(pvalue);
v = length(sortedposition);
for ii=1:v
    if q*ii/v >= sortedpvalue(ii)
        y(sortedposition(1:ii)) = 1;
    end
end

return;

第十六期 fNIRS Journal Club 视频

北京时间2021年1月23日周日下午1点, 瑞典 Karolinska Institutet的潘亚峰博士为大家讲解了他们最近发布的一篇用超扫描研究教师学生关系的文章。视频如下: Youtube: https://youtu.be/SrqU60b6lyk Youku: https://v.youku.com/v_show/id_XNTA4MDc2NjIwNA==.html
Xu Cui
5 sec read

第十六期 fNIRS Journal Club 通知 2021/01/23,1pm

瑞典 Karolinska Institutet的潘亚峰博士将为大家讲解他们最近发布的一篇用超扫描研究教师学生关系的文章。热烈欢迎大家参与讨论。潘博士为了这次报告,需要一大早就起床。因此本次报告的时间比过去要稍晚一点。 时间: 北京时间2021年1月23日周六下午1点地点: https://zoom.com房间号: 815 4986 9861密码: 796475 Pan, Guyon, Borragán, Hu, Peigneux (2020) Interpersonal brain synchronization with instructor compensates for learner’s...
Xu Cui
53 sec read

第十五期 fNIRS Journal Club 视频

北京时间2020年12月27日周日上午10点, 香港中文大学二年级博士生胡玥讲了一篇用神经网络去除运动伪迹的文章。视频如下: Youtube: https://youtu.be/mZkGzm1R7ak Youku: https://v.youku.com/v_show/id_XNTAyODUyMTEyOA==.html
Xu Cui
4 sec read

One Reply to “A mistake in my False discovery rate (FDR) correction…”

Leave a Reply

Your email address will not be published. Required fields are marked *

Loading