using System; using System.Collections.Generic; using S = Science.Statistics.BasicStatistics; namespace ScienceTest.StatisticsTest.BasicStatisticsTest { public class OneSampleTTestMSATTest { public OneSampleTTestMSATTest() { } private string result; public string Result { get{return result;} } public void Compute() { S.StandardDeviationAndAverage sd = new S.StandardDeviationAndAverage(); sd.Average = 420.0; sd.StandardDeviation = 110.0; sd.DegreesOfFreedom = 4; // 5 draws sd.FindStandardDeviationPlus(); sd.StandardDeviation = sd.StandardDeviationPlus; S.StandardErrorAndExpectedValue s = new S.StandardErrorAndExpectedValue(sd,5); result += s.ExpectedValueForAverage.ToString() + " "; result += s.StandardErrorForAverage.ToString() + "\r\n"; S.ObservedValue ov = new S.ObservedValue(); ov.Average = 550.0; S.OneSampleTTest test = new S.OneSampleTTest(s,ov,4); result += test.tValue.ToString() + " "; result += test.PValue.ToString() + "\r\n"; result += test.Conclusion+"\r\n"; } } } //420 55 //2.36363636363636 3.86777706520293 // Reject null at 5% level.