Changeset 11692
- Timestamp:
- 12/17/14 11:31:26 (10 years ago)
- Location:
- branches/StatisticalTesting
- Files:
-
- 2 added
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/HeuristicLab.Analysis.Statistics-3.3.csproj
r11671 r11692 146 146 <DependentUpon>StatisticalTestingView.cs</DependentUpon> 147 147 </Compile> 148 <Compile Include="KruskalWallis .cs" />148 <Compile Include="KruskalWallisTest.cs" /> 149 149 <Compile Include="CorrelationView.cs"> 150 150 <SubType>UserControl</SubType> … … 161 161 <Compile Include="Plugin.cs" /> 162 162 <Compile Include="Properties\AssemblyInfo.cs" /> 163 <Compile Include=" TTest.cs" />163 <Compile Include="PairwiseTest.cs" /> 164 164 </ItemGroup> 165 165 <ItemGroup> -
branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/SampleSizeDetermination.cs
r11671 r11692 85 85 s2 = d2.Variance(); 86 86 87 return (x1 - x2) / Math.Sqrt((s1 + s2) / 2);87 return Math.Abs(x1 - x2) / Math.Sqrt((s1 + s2) / 2); 88 88 } 89 89 … … 104 104 105 105 s = Math.Sqrt(((n1 - 1) * s1 + (n2 - 1) * s2) / (n1 + n2 - 2)); 106 g = (x1 - x2) / s;106 g = Math.Abs(x1 - x2) / s; 107 107 c = (1 - (3 / (4 * (n1 + n2) - 9))) * g; 108 108 -
branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/StatisticalTestingView.cs
r11691 r11692 303 303 304 304 private void TestAllGroups() { 305 double pval = KruskalWallis .Test(data);305 double pval = KruskalWallisTest.Test(data); 306 306 pValTextBox.Text = pval.ToString(); 307 307 if (pval < significanceLevel) { … … 359 359 360 360 double[][] newData = FilterDataForPairwiseTest(colIndex); 361 362 double mwuBothtails;363 double mwuLefttail;364 double mwuRighttail;365 361 int cnt = 0; 366 367 362 for (int i = 0; i < newData.Length; i++) { 368 alglib.mannwhitneyutest(data[colIndex], data[colIndex].Length, newData[i], newData[i].Length, out mwuBothtails, out mwuLefttail, out mwuRighttail);363 double mwuBothtails = PairwiseTest.MannWhitneyUTest(data[colIndex], newData[i]); 369 364 if (mwuBothtails > significanceLevel) { 370 365 cnt++; … … 435 430 436 431 double mwuBothtails; 437 double mwuLefttail;438 double mwuRighttail;439 432 double tTestBothTails; 440 433 double[] mwuPValues = new double[newData.Length]; … … 445 438 446 439 for (int i = 0; i < newData.Length; i++) { 447 if (i != colIndex) { 448 alglib.mannwhitneyutest(data[colIndex], data[colIndex].Length, newData[i], newData[i].Length, out mwuBothtails, 449 out mwuLefttail, out mwuRighttail); 450 tTestBothTails = TTest.Test(data[colIndex], newData[i]); 451 mwuPValues[i] = mwuBothtails; 452 tTestPValues[i] = tTestBothTails; 453 } 440 mwuBothtails = PairwiseTest.MannWhitneyUTest(data[colIndex], newData[i]); 441 tTestBothTails = PairwiseTest.TTest(data[colIndex], newData[i]); 442 mwuPValues[i] = mwuBothtails; 443 tTestPValues[i] = tTestBothTails; 454 444 } 455 445 … … 458 448 459 449 for (int i = 0; i < newData.Length; i++) { 460 if (i != colIndex) { 461 pValsMatrix[0, i] = mwuPValues[i]; 462 pValsMatrix[1, i] = adjustedMwuPValues[i]; 463 pValsMatrix[2, i] = tTestPValues[i]; 464 pValsMatrix[3, i] = adjustedTtestPValues[i]; 465 pValsMatrix[4, i] = SampleSizeDetermination.CalculateCohensD(data[colIndex], newData[i]); 466 pValsMatrix[5, i] = SampleSizeDetermination.CalculateHedgesG(data[colIndex], newData[i]); 467 } 450 pValsMatrix[0, i] = mwuPValues[i]; 451 pValsMatrix[1, i] = adjustedMwuPValues[i]; 452 pValsMatrix[2, i] = tTestPValues[i]; 453 pValsMatrix[3, i] = adjustedTtestPValues[i]; 454 pValsMatrix[4, i] = SampleSizeDetermination.CalculateCohensD(data[colIndex], newData[i]); 455 pValsMatrix[5, i] = SampleSizeDetermination.CalculateHedgesG(data[colIndex], newData[i]); 468 456 } 469 457 -
branches/StatisticalTesting/Statistics.UnitTests/KruskalWallisUnitTests.cs
r11375 r11692 36 36 data[2] = new double[] { 2.8, 3.4, 3.7, 2.2, 2.0 }; 37 37 38 Assert.AreEqual(0.68, Math.Round(KruskalWallis .Test(data), 2));38 Assert.AreEqual(0.68, Math.Round(KruskalWallisTest.Test(data), 2)); 39 39 } 40 40 … … 62 62 ,3605,4162,493,330,4595,2699,4457,3981,3499,1773,653,3176,134,3205,4537 }; 63 63 64 Assert.AreEqual(0.95, Math.Round(KruskalWallis .Test(data), 2));64 Assert.AreEqual(0.95, Math.Round(KruskalWallisTest.Test(data), 2)); 65 65 } 66 66 … … 110 110 ,-0.947125493,2.087444922,0.271276104,-1.027604792,-0.364097727,-0.741089219}; 111 111 112 Assert.AreEqual(0.0253, Math.Round(KruskalWallis .Test(data), 4));112 Assert.AreEqual(0.0253, Math.Round(KruskalWallisTest.Test(data), 4)); 113 113 } 114 114 … … 150 150 ,-0.947125493,2.087444922,0.271276104,-1.027604792,-0.364097727,-0.741089219}; 151 151 152 var result = KruskalWallis .Test(data);152 var result = KruskalWallisTest.Test(data); 153 153 Assert.IsTrue(result.IsAlmost(2.2E-16)); 154 154 } … … 167 167 ,2654,4588,3363,4750,1440,1892,3629,816,4317,34,2119,3290,1758 }; 168 168 169 Assert.AreEqual(1, Math.Round(KruskalWallis .Test(data), 2));169 Assert.AreEqual(1, Math.Round(KruskalWallisTest.Test(data), 2)); 170 170 } 171 171 }
Note: See TracChangeset
for help on using the changeset viewer.