IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
vectorcomp_utest.m
Go to the documentation of this file.
1 %> Vector Comparer - Mann-Whitney's U-test
2 %>
3 %> It actually uses MATLAB's ranksum() function (Wilcoxon rank sum test), but the documentation says that this is equivalent to the
4 %> Mann-Whitney test
5 %>
6 %> A positive value means that the first vector is "better" than the second. A negative value means the opposite.
8  properties
9  %> Whether to make result as -log10(p_value)
10  flag_logtake = 1;
11  end;
12  methods(Access=protected)
13  function z = do_test(o, v1, v2)
14  z = ranksum(v1, v2);
15  if o.flag_logtake
16  z = -log10(z);
17  end;
18  z = [z, -z];
19  if mean(v1) < mean(v2)
20  z = -z;
21  end;
22  end;
23  end;
24 
25  methods
26  function o = vectorcomp_utest(o)
27  o.classtitle = 'U-Test';
28  o.flag_params = 0;
29  end;
30  end;
31 end
Paired Vector Comparer base class.
Definition: vectorcomp.m:9
Analysis Session (AS) base class.
Definition: as.m:6