using System; using System.Collections.Generic; using System.Linq; using System.Text; using S = Science.Statistics.BasicStatistics; namespace Statistics4Ed.Chapter28.SetB { 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(315, 313); table.Add(101, 104); table.Add(108, 104); table.Add(32, 35); result += table.ToString(); S.OneSampleChiSquareTest chitest = new S.OneSampleChiSquareTest(table, 3); result += chitest.DegreesOfFreedom.ToString() + " "; result += chitest.ChiSquare.ToString() + " "; result += chitest.PValue + "\r\n"; } } } /* 315 313 101 104 108 104 32 35 3 0.510307025243127 91.6621237907985 */