Accord.Tests.Statistics.TwoSampleWilcoxonSignedRankTestTest.WilcoxonSignedRankTestConstructorTest2 C# (CSharp) Method

WilcoxonSignedRankTestConstructorTest2() private method

private WilcoxonSignedRankTestConstructorTest2 ( ) : void
return void
        public void WilcoxonSignedRankTestConstructorTest2()
        {
            // Example from http://vassarstats.net/textbook/ch12a.html
            double[] sample1 = { 78, 24, 64, 45, 64, 52, 30, 50, 64, 50, 78, 22, 84, 40, 90, 72 };
            double[] sample2 = { 78, 24, 62, 48, 68, 56, 25, 44, 56, 40, 68, 36, 68, 20, 58, 32 };

            TwoSampleHypothesis alternate = TwoSampleHypothesis.FirstValueIsSmallerThanSecond;
            var target = new TwoSampleWilcoxonSignedRankTest(sample1, sample2, alternate);

            // The referred example uses the summed W statistic. The framework
            // uses the positive W statistic. There is no difference, if proper
            // respective statistical tables (or distributions) are followed.

            Assert.AreEqual(86, target.Statistic); // W = 67
            Assert.AreEqual(14, target.Samples);
            Assert.IsTrue(target.Significant);
            Assert.IsTrue(target.PValue > 0.01 && target.PValue < 0.05);
        }