Accord.Tests.Statistics.TwoSampleZTestTest.TwoSampleZTestConstructorTest2 C# (CSharp) Method

TwoSampleZTestConstructorTest2() private method

private TwoSampleZTestConstructorTest2 ( ) : void
return void
        public void TwoSampleZTestConstructorTest2()
        {
            // Example from http://www.stat.purdue.edu/~tlzhang/stat511/chapter9_1.pdf

            double mean1 = 29.8;
            double var1 = System.Math.Pow(4.0, 2);
            int samples1 = 20;

            double mean2 = 34.7;
            double var2 = System.Math.Pow(5.0, 2);
            int samples2 = 25;

            TwoSampleZTest target = new TwoSampleZTest(
                mean1, var1, samples1,
                mean2, var2, samples2);

            Assert.AreEqual(mean1, target.EstimatedValue1);
            Assert.AreEqual(mean2, target.EstimatedValue2);

            Assert.AreEqual(-3.66, target.Statistic, 0.01);

            var range = target.GetConfidenceInterval(0.99);
            Assert.AreEqual(-8.36, range.Min, 0.01);
            Assert.AreEqual(-1.44, range.Max, 0.01);

            Assert.IsTrue(target.Significant);

            target.Size = 0.01;

            Assert.IsTrue(target.Significant);
        }