using System; using System.Collections.Generic; using System.Linq; using System.Text; using S = Science.Statistics.BasicStatistics; namespace Statistics4Ed.Chapter28.SetC { public class Exercise02 { public Exercise02() { } private string result; public string Result { get{return result;} } public void Compute() { double[,] table = new double[2, 2]; table[0, 0] = 2792.0; table[0, 1] = 3591.0; table[1, 0] = 1486.0; table[1, 1] = 2131.0; S.ChiSquareTestForIndependence chitest = new S.ChiSquareTestForIndependence(table); result += chitest.DegreesOfFreedom.ToString() + " "; result += chitest.ChiSquare.ToString() + " "; result += chitest.PValue + "\r\n"; } } } /* 1 6.66045589932807 0.985756931831464 */