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;



写作助手,把中式英语变成专业英文


Want to receive new post notification? 有新文章通知我

第五十六期fNIRS Journal Club通知2024/09/28, 10am 李开云副教授

孤独症谱系障碍(Autism Spectrum Disorder, ASD)是一种复杂的神经发育障碍,其核心特征包括社交沟通障碍、重复刻板行为和限制性兴趣。济南大学教育与心理科学学院李开云博士借助fN
Wanling Zhu
21 sec read

第五十五期fNIRS Journal Club视频 张迎伟博士

Youtube: https://youtu.be/V5eNKNgGOoU 优酷:https://v.youku.com/v_show/id_XNjQxNzU0Mjc0NA==.html 遗忘型轻度认
Wanling Zhu
16 sec read

第五十五期fNIRS Journal Club通知2024/08/24, 10am 张迎伟博士

遗忘型轻度认知障碍(aMCI) 的辅助评估和早期诊断对于防止老年痴呆至关重要。来自中科院计算技术研究所的张迎伟博士将分享 fNIRS 表征和尺度多模态融合方法在aMCI辅助诊断方面的研究。欢迎大家踊跃
Wanling Zhu
12 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 *