Accord.Statistics.Distributions.Univariate.MannWhitneyDistribution.USample2 C# (CSharp) Method

USample2() public static method

Gets the Mann-Whitney's U statistic for the second sample.
public static USample2 ( double rank2, int n1 ) : double
rank2 double
n1 int
return double
        public static double USample2(double[] rank2, int n1)
        {
            int n2 = rank2.Length;
            double t2 = rank2.Sum();
            double t2max = n2 * n1 + (n2 * (n2 + 1)) / 2.0;
            double u2 = t2max - t2;
            return u2;
        }