FDR correction matlab script

40 sec read

The following script is to determine is a channel (or voxel) survives the FDR corrected threshold. Assume you have 48 channels and you already calculated the (uncorrected) p-value of each channel. You put it into an array called p. Now you want to know which channel will survive if you do a FDR correction at q=0.05. You may simply use

fdr0(p, 0.05)

The output is an array of 48 numbers, with 1s in the channel where it survives the FDR threshold.

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(ii)) = 1;
    end
end

return;



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


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

第四十一期fNIRS Journal Club通知2023/6/3, 10am 徐四华教授

人际关系和群体中个体的特征是否会影响正常交互中面临不确定性时的群体决策?来自上海外国语大学的徐四华教授将分享如何利用近红外成像技术揭示在不同人际关系和人际取向中的群体决策倾向的神经机制。 时间:北京时
Xu Cui
9 sec read

第四十期fNIRS Journal 视频 张丹丹教授

Youtube: https://youtu.be/ljQt7XXcVXwYouku: https://v.youku.com/v_show/id_XNTk2MDc4NjM5Ng==.html 个人简
Xu Cui
6 sec read

第四十期fNIRS Journal Club通知2023/5/6, 10am 张丹丹教授

人类新生儿对语言具有高度的敏感性,刚出生的新生儿能加工各种复杂的语音刺激。来自四川师范大学的张丹丹教授将分享如何利用近红外脑成像技术研究新生儿对语音的加工及学习。欢迎大家踊跃参与和讨论。 时间:北京时
Xu Cui
2 sec read

Leave a Reply

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