public void WilcoxonSignedRankTestConstructorTest3()
{
// Example from http://courses.wcupa.edu/rbove/Berenson/CD-ROM%20Topics/topice-10_5.pdf
double[] sample1 = { 9.98, 9.88, 9.84, 9.99, 9.94, 9.84, 9.86, 10.12, 9.90, 9.91 };
double[] sample2 = { 9.88, 9.86, 9.75, 9.80, 9.87, 9.84, 9.87, 9.86, 9.83, 9.86 };
var target = new TwoSampleWilcoxonSignedRankTest(sample1, sample2,
alternate: TwoSampleHypothesis.FirstValueIsSmallerThanSecond);
Assert.AreEqual(TwoSampleHypothesis.FirstValueIsSmallerThanSecond, target.Hypothesis);
double[] delta = { 0.1, 0.02, 0.09, 0.19, 0.07, 0, 0.01, 0.26, 0.07, 0.05 };
double[] ranks = { 7, 2, 6, 8, 4.5, 0, 1, 9, 4.5, 3 };
int[] signs = { +1, +1, +1, +1, +1, 0, -1, +1, +1, +1 };
Assert.IsTrue(delta.IsEqual(target.Delta, 1e-6));
Assert.IsTrue(ranks.IsEqual(target.Ranks, 1e-6));
Assert.IsTrue(signs.IsEqual(target.Signs));
Assert.AreEqual(44, target.Statistic);
Assert.IsTrue(target.Significant);
}