Esempio n. 1
0
 private void Button_OnClick(object sender, RoutedEventArgs e)
 {
     Instance i = new Instance();
     i.ParseInput(File.Text);
     AnovaResult a = i.Calculate();
     Text.Text = a.ToString();
 }
Esempio n. 2
0
 /// <summary>
 /// Creates an instance of the library interface class
 /// Immediately attempts parsing- if that fails, it returns false
 /// </summary>
 /// <param name="filepath"></param>
 /// <returns>True if instance created, and data parsed correctly.
 /// Otherwise, false.</returns>
 public bool CreateInstance(string filepath)
 {
     Instance instance = new Instance();
     bool success = instance.ParseInput(filepath);
     if (success)
         libraryInstance = instance;
     return success;
 }
Esempio n. 3
0
 public void Page666Test()
 {
     Instance i = new Instance();
     i.ParseInput(@"TestFiles/StatsBookExamplePage666.csv");
     AnovaResult result = i.Calculate();
     Assert.AreEqual(7.5492, Math.Round(result.SST, 4));
     Assert.AreEqual(5.8617, Math.Round(result.SSE, 4));
     Assert.AreEqual(1.6875, Math.Round(result.SSB, 4));
     Assert.AreEqual(1.6875, Math.Round(result.MSB, 4));
     Assert.AreEqual(.5862, Math.Round(result.MSE, 4));
     Assert.AreEqual(2.88, Math.Round(result.F, 2));
     Assert.AreEqual(0.1206, Math.Round(result.P, 4));
 }
Esempio n. 4
0
 public void Page670Test()
 {
     Instance i = new Instance();
     i.ParseInput(@"TestFiles/StatsBookExample670.xlsx");
     AnovaResult result = i.Calculate();
     Console.WriteLine(result.ToString());
     Assert.AreEqual(1909.2, Math.Round(result.SST, 1));
     Assert.AreEqual(1196.6, Math.Round(result.SSE, 1));
     Assert.AreEqual(712.6, Math.Round(result.SSB, 1));
     Assert.AreEqual(237.5, Math.Round(result.MSB, 1));
     Assert.AreEqual(63, Math.Round(result.MSE, 0));
     Assert.AreEqual(3.77, Math.Round(result.F, 2));
     Assert.AreEqual(3, Math.Round(result.SSBDegreesOfFreedom,4));
     Assert.AreEqual(19, Math.Round(result.SSEDegreesOfFreedom, 4));
     Assert.AreEqual(22, Math.Round(result.SSTDegreesOfFreedom,4));
     Assert.AreEqual(.0280, Math.Round(result.P, 4));
 }
Esempio n. 5
0
 public void InstanceTestExcel()
 {
     Instance i = new Instance();
     i.ParseInput(@"TestFiles/SmallExcelFile.xlsx");
     AnovaResult result = i.Calculate();
     AnovaResult expectedResult = new AnovaResult
     {
         SST = 280,
         SSE = 30,
         SSB = 250,
         SSTDegreesOfFreedom = 14,
         SSBDegreesOfFreedom = 2,
         SSEDegreesOfFreedom = 12,
         F = 50,
         MSB = 125,
         MSE = 2.5
     };
     Assert.AreEqual(expectedResult, result);
 }