Step up correction for multiple comparisons. FORMAT H = pr_hoch(p,alfa,No,sortf) Input: p - pvalues alfa - FWE No - number of Null Hypotheses sortf - is 1 if p is already sorted ascending Output: H - vector of rejections 1 hypothesis rejected 0 otherwise References: Hochberg Y (1988) "A sharper Bonferroni procedure for multiple tests of significance," Biometrika 75:800-803 Hochberg Y, Benjamini Y (1990) "More powerful procedures for multiple significance testing," Statist. Med. 9:811-818 Federico E. Turkheimer 15/6/2000 $Id: pr_hoch.m,v 1.1 2005/06/01 09:24:23 matthewbrett Exp $
0001 function H = pr_hoch(p,alfa,No,sortf) 0002 % Step up correction for multiple comparisons. 0003 % FORMAT H = pr_hoch(p,alfa,No,sortf) 0004 % 0005 % Input: 0006 % p - pvalues 0007 % alfa - FWE 0008 % No - number of Null Hypotheses 0009 % sortf - is 1 if p is already sorted ascending 0010 % 0011 % Output: 0012 % H - vector of rejections 0013 % 1 hypothesis rejected 0014 % 0 otherwise 0015 % 0016 % References: 0017 % Hochberg Y (1988) "A sharper Bonferroni procedure for 0018 % multiple tests of significance," Biometrika 75:800-803 0019 % 0020 % Hochberg Y, Benjamini Y (1990) "More powerful procedures for 0021 % multiple significance testing," Statist. Med. 9:811-818 0022 % 0023 % Federico E. Turkheimer 15/6/2000 0024 % 0025 % $Id: pr_hoch.m,v 1.1 2005/06/01 09:24:23 matthewbrett Exp $ 0026 0027 if nargin < 1 0028 error('Need p values'); 0029 end 0030 if nargin < 2 0031 alfa = 0.05; 0032 end 0033 n = length(p); 0034 if nargin < 3 0035 No = n; 0036 elseif No > n 0037 No = n; 0038 end 0039 if nargin < 4 0040 sortf = 0; 0041 end 0042 if ~sortf 0043 q = sort(p(:)); 0044 else 0045 q = p(:); 0046 end 0047 0048 H1 = q < alfa./(min(No, (n:-1:1)'+1)); 0049 th = max([q(H1); 0]); 0050 H = p<= th; 0051 0052 return