using System; using System.Collections.Generic; using System.Linq; using System.Text; using S = Science.Statistics.BasicStatistics; namespace Statistics4Ed.Chapter28.SetA { public class Exercise03 { public Exercise03() { } private string result; public string Result { get{return result;} } public void Compute() { S.FrequencyTable table = new S.FrequencyTable(); table.Add(5, 10); table.Add(7, 10); table.Add(17, 10); table.Add(16, 10); table.Add(8, 10); table.Add(7, 10); result += table.ToString(); S.OneSampleChiSquareTest chitest = new S.OneSampleChiSquareTest(table, 5); result += chitest.DegreesOfFreedom.ToString() + " "; result += chitest.ChiSquare.ToString() + " "; result += chitest.PValue + "\r\n"; } } } /* 5 10 7 10 17 10 16 10 8 10 7 10 5 13.2 2.15749276380526 */